XHTML 1.1 Tutorial

Basic Tags

Tag Purpose
<!DOCTYPE> Defines type of the document
Declaration of DOCTYPE is necessary.

Currently, this field can be one of these 3 types - Strict, Transitional, Frameset
Strict is used when no presentational clutter is about to used on your content
Transitional The most common one, this is used when you prefer to use presentational features, or to make your page compatible with the browser that doesn't support Cascading Style Sheets.
Frameset is used when you want to plan to split the browser's window into frame

For XHTML 1.1, use
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">    for more information click here

<html> Defines a html document
This item indicates that the page is an HTML document.
This field must appear only once in the document.

Make sure that the xmlns attribute as
<html xmlns="http://www.w3.org/1999/xhtml">

<body> Defines the body of the documents.
This item indicates the body of your document.
This field must appear only once in the document

All of your contents displayed on the webpage should appeared under this tag.
Please be aware that all "presentation attributes" are not supported in XHTML 1.0 Strict DTD.

<h1> to <h6> Defines header, from the most significant header 1 to least significant header 6
<h1> indicates the largest header. <h6> indicates the smallest header.
If you are familier with HTML, please note that the attribute 'align' is not supported in Strict DTD, use 'style' instead.

<p> Defines a paragraph
It is used to indicates a paragraph. Again, if you are familier with HTML please note that the "presentation attributes" are not supported in XHTML 1.0 Strict DTD, make use of CSS instead.

<br /> Line break
Insert one blank line to your content, however, it is not to separate paragraphs.
Please note that every tag in XHTML that doesn't has its pair, it must has '/' after the tag's attribute. For this tag to be properly inserted to your content, it must be written as <br />

<hr /> Defines a horizontal rule
This tag is for inserting the horizontal rule., horizontal rule is simply a line that partition your content in horizontal view.
This tag doesn't has its pair, so you need to put '/' at the end of the tag's attribute. It must be written as '<hr />'

<!--...--> Defines a comment
Sometimes you want to put your comment on your XHTML source while not wanting it to appear on the brower, this tag comes into action. When browser find this tag, it ignore the code.
This tag also used when you want to put a program-specific information. Although the comment information not appeared in the browser, they are still available to the program.


Previous Next

This tutorial is final project for INFSCI 2000, Fall 2004
Copyright 2004 School of Information Science, University of Pittsburgh