|
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
A collection of 22 FAQs/tutorials tips on XHTML document structure and head level elements. Clear answers are provided with tutorial exercises on XHTML DTD specifications and the root element; the head and body elements; head level elements like title, meta, base, script, link, and style; description and keywords meta elements.
Topics included in this collection are:
- What is the Top Level Structure of an XHTML Document?
- How Many Document Types Defined in XHTML 1.0?
- What Is the HTML Tag/Element?
- What is the Second Level Structure of an XHTML Document?
- What Is the HEAD Tag/Element?
- What Is the BODY Tag/Element?
- How To Write a HEAD Element Properly?
- What Is the TITLE Tag/Element?
- What is a Smallest Valid XHTML Dodument?
- What Is Wrong with This HEAD Element?
- What Happens If the TITLE Element is Missing?
- What Happens If a META Element Is Not Closed?
- What Is a META Tag/Element?
- What Is the Description META Tag/Element?
- What Is the Keywords META Tag/Element?
- What Is the Robots META Tag/Element?
- What Is a http-equiv META Tag/Element?
- What Is the Author META Tag/Element?
- What Is the Base Tag/Element?
- What Is a Script Tag/Element?
- What Is a Link Tag/Element?
- What Is a Style Tag/Element?
Please note that all notes and tutorials are based on XHTML 1.0 specification.
What is the Top Level Structure of an XHTML Document?
The top level structure of a XHTML document consists of three parts:
- XML processing instruction - Provides XML version information and character set
declaration.
- Document type declaration - Provides the document type and version information, as well as
the URI referring to the DTD that matches the type and version.
- HTML element - Provides the contents of the XHTML document.
The HTML element is defined with the "html" tag.
The following tutorial sample shows you how the XHTML top 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>
(Second level structure)
</html>
How Many Document Types Defined in XHTML 1.0?
There are only 3 document types are defined in XHTML 1.0:
1. Strict type: Only allow non-deprecated and non-frameset XHTML elements in this type.
Strict type should be declared as below:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2. Transitional type: Allow all XHTML elements defined in "strict" type, plus other
elements that are deprecated in HTML 4.0. Transitional type should be declared as below:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3. Frameset type: Allow all XHTML elements defined in "transitional" type, plus frame related
elements. Transitional type should be declared as below:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
What Is the HTML Tag/Element?
The html element is the first element you need to learn.
The html element is used to enclose the entire HTML document.
Here are some rules about the html element:
- The html element is the only top level element.
The html element is also called the root element.
- The html element must contain the entire XHTML document.
No other text or elements can be placed outside the html element.
- The html element must be coded
with the html opening tag, <html>, and the html closing tag, </html>.
(Continued on next part...)
Part:
1
2
3
4
5
6
|