|
Home >> FAQs/Tutorials >> XHTML Tutorials and Tips >> Index
XHTML 1.0 Tutorials - Document Structure and Head Level Tags
By: FYICenter.com
Part:
1
2
3
4
5
6
(Continued from previous part...)
What is the Second Level Structure of an XHTML Document?
The second level structure of an XHTML document consists of two parts:
- Head element - Contains information about the current document, such as its title,
keywords that may be useful to search engines, and other data that is
not considered document content. The head element is defined with the "head" tag.
- Body element - Contains the real content of the current document, including text, images,
and other types data. The head element is defined with the "head" tag.
The following tutorial sample shows you how the HTML second level structure looks like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
(Head structure)
</head>
<body>
(Body structure)
</body>
</html>
What Is the HEAD Tag/Element?
The head element is the second element you need to learn.
The head element is used to provide information about the XHTML document.
The head element should not be used to contain any contents of the XHTML document.
Here are some rules about the head tag/element:
- The head element is a second level element.
The head element must be the first child element of the html element.
- You can only place a single head element in an XHTML document.
- The head element must be coded with
the head opening tag, <head>, and the head closing tag, </head>.
- The head element must have one title element as the required child element.
- The head element can have other optional elements.
- The head element can not have any text information directly included between
the opening and closing tags.
What Is the BODY Tag/Element?
The body element is the third element you need to learn.
The body element is used to provide content of the XHTML document.
Here are some rules about the body tag/element:
- The body element is a second level element.
The body element must be the second child element of the html element.
- You can only place a single body element in an XHTML document.
- The body element must be coded with
the body opening tag, <body>, and the body closing tag, </body>.
- The body element can not be empty.
The body must have one or more block-type elements
- The body element can not have any text information directly included between
the opening and closing tags.
How To Write a HEAD Element Properly?
The head element can not be empty. It must contain the title element,
defined by the "title" tag. The head element may contain a number of
other miscellaneous elements, like base, script, style, meta, link,
and object elements.
Here is good head element:
<head>
<title>My First HTML Document</title>
<base href="http://dev.fyicenter.com /">
<meta name="Author" content="FYIcenter.com" />
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
<script type="text/javascript" src="_local.js" />
<link rel="stylesheet" type="text/css" href="_local.css" />
</head>
What Is the TITLE Tag/Element?
The title element is the 4th element you need to learn.
The title element is used to provide a text title to the XHTML document.
Here are some rules about the head tag/element:
- The title element is a required child element of the head element.
- You must place a single title element in the head element.
- The title element must be coded with
the title opening tag, <title>, and the title closing tag, </title>.
- The title element must have PCDATA content, which is parsed text string only.
No sub-elements are allowed.
- The content of the title element will be displayed in the title area on the browser window.
- The content of the title element is used by most search engines to match the search string.
(Continued on next part...)
Part:
1
2
3
4
5
6
|