HTML - Part 1
HTML - Part 1
● The tag name is not case-sensitive, although the World Wide Web
Consortium (W3C) recommends using lowercase letters in current
versions of HTML.
● <html>, <head>, <body> and <title> tags provides the basic structure of
and HTML Doc.
● HTML Docs are well structured documents. <html> tags is the root of
the document and <head> and <body> are branches (nested in <htmL>
tags). This creates a “tree” like structure to hold the content.
● The <!DOCTYPE> declaration at the very top if the doc is not a HTML
tag, but an instruction to the browser about the HTML version used.
Anatomy: HTML Comments
Tags may include one or more attributes to specify details of the HTML
element.
Core attributes: title, id, style, class and lang available for any HTML
element
Title
The document title is specified using the <title> element.
● Browser Tab/Title Bar: The title appears in the tab or title bar of the browser
window, providing a concise label for the page.
● Search Engine Results Pages (SERPs): When your page shows up in search results,
the title tag is often used as the clickable headline.
● Browser Bookmarks/Favorites: If a user bookmarks your page, the title tag is
typically used as the bookmark's name.
Anatomy: Metadata
● <meta> elements found in <head> are used to describe the content of an HTML
document
● name, http-equiv, content and charset attributes are used in <meta> tags.
● <meta http-equiv="refresh" content="30"> auto reload the page every 30
seconds
● <meta http-equiv="refresh" content="30; url=http://google.com"> redirects
the page to google.com
● <meta charset="utf-8"> specifies documents character encoding (Latin
alphabet ISO-8859-1)
● Meta tags can be used to set cookies to track site visitors
● Take control over the viewport (visible area of the screen) (Responsive web
design etc.)
Q&A Session
Questions
01. For each of the following tags, indicate the corresponding closing tag:
<body> , <head>, <html>, <meta>, <title>
02. What is the difference between a tag and an element? Use this entry
as a reference
<title>HTML Page Title</title>
03. What are the tags between which a comment should be placed?
04. Explain what an attribute is and provide some examples for the <meta>
tag.
13
Break – 15 Mins
14
Teacher Demonstration – 45 Mins
15
Group Discussion
01. Create a simple HTML version 5 document with the title My first HTML document
and only one paragraph in the body, containing the text Hello World. Use the
paragraph tag <p> in the body
02. Add the author (Kevin Author) and description (This is my first HTML page.) of the
HTML document.
03. Add the following keywords related to the HTML document: HTML, Example, Test,
and Metadata.
04. Add the element <meta charset=”ISO-8859-1”> to the document header and
change the Hello World text to Japanese (こんにちは世界). What happens? How can
you solve the problem?
05. After changing the paragraph text back to Hello World, redirect the HTML page to
https://www.google.com after 30 seconds and add a comment explaining this in
the document header.
16
Learning Objectives
18