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:

  1. What is the Top Level Structure of an XHTML Document?
  2. How Many Document Types Defined in XHTML 1.0?
  3. What Is the HTML Tag/Element?
  4. What is the Second Level Structure of an XHTML Document?
  5. What Is the HEAD Tag/Element?
  6. What Is the BODY Tag/Element?
  7. How To Write a HEAD Element Properly?
  8. What Is the TITLE Tag/Element?
  9. What is a Smallest Valid XHTML Dodument?
  10. What Is Wrong with This HEAD Element?
  11. What Happens If the TITLE Element is Missing?
  12. What Happens If a META Element Is Not Closed?
  13. What Is a META Tag/Element?
  14. What Is the Description META Tag/Element?
  15. What Is the Keywords META Tag/Element?
  16. What Is the Robots META Tag/Element?
  17. What Is a http-equiv META Tag/Element?
  18. What Is the Author META Tag/Element?
  19. What Is the Base Tag/Element?
  20. What Is a Script Tag/Element?
  21. What Is a Link Tag/Element?
  22. 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 


Selected Developer Jobs:

More...