Tuesday, December 28, 2010

Practical 03 - Header of HTML Document

1) The Document Header:
 The HTML document header describes the various properties of the document, including its title, position within the Web, and relationship with other documents. Most of the data contained within the document header are never actually rendered as content visible to the user.
2) The <head> Tag:
 The <head> tag has no attributes and serves only to encapsulate the other header tags. Since it always occurs near the beginning of a document, just after the <html> tag and before the <body> or <frameset> tag, both the <head> tag and its corresponding ending </head> can be unambiguously inferred by the browser and so can be safely omitted from the document. Nonetheless, we do encourage you to include them in your documents, since it promotes readability and better supports document automation.

<head>
Function:
Defines the document header
Attributes:
None
End tag:
</head>; rarely omitted
Contains:
head_content
Used in:
html_tag

The <head> tag may contain a number of other tags that help define and manage the document's content. These include, in any order of appearance: <base>, <basefont>, <isindex>, <link>, <meta>, <nextid>, and <title>. For more information, see Chapter 6, Links and Webs.
3) The <title> Tag:
 The <title> tag does exactly what you might expect: the words you place inside its start and end tags define the title for your document. (We told you this stuff is pretty much self-explanatory and easier than you might think at first glance.) The title is used by the browser in some special manner, most often placed in the browser window's title bar or on a status line. Usually, too, the title becomes the default name for a link to the document if the document is added to a link collection or to a user's ``hot list.''

<title>
Function:
Defines the document title
Attributes:
None
End tag:
</title>; never omitted
Contains:
plain_text
Used in:
head_content

The <title> tag is the only thing required within the <head> tag. Since the <head> tag itself and even the <html> tag may be safely omitted, the <title> tag could be the first line within a valid HTML document. Beyond that, most browsers will even supply a generic title for documents lacking a <title> tag, such as the document's filename, so you don't even have to supply a title. That goes a bit too far even for our down-and-dirty tastes. No respectable author of an HTML document should serve up a document missing the <title> tag and a title.
Browsers do not specially format title text and ignore anything other than text inside the title start and end tags, such as images or links to other documents.
Here's an even barer barebones example of a valid HTML document to highlight the header and title tags:

<html>
<head>
<title>Using HTML: The Definitive Guide</title>
</head>
</html>
What's in a title?
Selecting the right title is crucial to defining a document and ensuring that it can be effectively used within the World Wide Web.

4) Related Header Tags:
 Other tags you may include within the <head> tag deal with specific aspects of document creation, management, linking, or automation. That's why we only mention them here briefly, and they are far from scope of the course of grade 9.
Briefly, the special header tags are:
<link> and <base>
Define the current document's base location and relationship to other documents.
<isindex>
Creates automatic document indexing forms, allowing users to search databases of information using the current document as a querying tool.
<nextid>
Makes creation of unique document labels easier when using document automation tools.
<meta>
Provides additional document data not supplied by any of the other <head> tags.
<basefont>
Defines the default font size for a font model that some advanced browsers support, but that is not part of the HTML 2.0 standard.
Besides we can also add <Script> which also can be placed in HTML body.

No comments:

Post a Comment