Your Ad Here

Use head and body Appropriately


Use <head> and <body>
Appropriately


Once your root elements are in place, you can add the head and body portions of
your document. Addressing the idea of not using these very basic HTML elements
might seem silly, but I have seen countless pages where these critical tags either
don’t exist, are improperly nested, or appear more than once—or have the wrong
type of information within them.
The head portion of a document comes after the root and before the body elements.
The head of a document is like the head of a human—it contains all the stuff that’s
used to keep things working, such as the following:
Title. This is the title that will appear in the browser’s title bar.
Metadata. All forms of meta information, including description,
keywords, and character set definitions.
Scripts. Document-related scripts can appear in the head within or
linked to the document via the script element.
CSS. Embedded CSS can appear in the head between the style
element, external CSS can be imported using the style element, and
external CSS can be linked using the link element.
Aggregation. XML-based aggregation such as Rich Site Summary
(RSS), Resource Description Framework (RDF), and related formats can
be linked from the head using the link element.
Favicons. You know them as the little icons that appear in the address
bar of certain browsers. You can add them using the link element with
the head portion of a document.


HTML markup that is not allowed in the head portion of a document is any html
element or attribute not related to metadata, scripting, style, and other information
about rather than on the page. The only exception to these items is that special
characters can be used in the text content of titles:
<title>Sugar &amp; Spice</title>
Directly below the head and its contents is the body. Almost every element and
attribute used within the body relates either to the structuring of content, or to its
formatting (although again, CSS is encouraged for all presentation). Sometimes,
scripting is included.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>


</head>
<body>
</body>
</html>


0 comments:

Post a Comment

Popular Posts

Recent posts