HTML and CSS Reference
In-Depth Information
The version and type of XHTML is listed in the Document Type Definition (DTD) tag
(commonly called the DOCTYPE ). The DTD identifies the version and type of XHTML
contained in your document. Browsers and HTML code validators can use the informa-
tion in the DTD when processing the Web page. The DTD tag is placed at the top of a
Web page document, even before the <html> tag. The DTD for XHTML 1.0
Transitional is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
You will place the DTD as the second line in each Web page document you create. Are
you ready to create your first Web page?
2.4 Your First Web Page
After the DTD, each Web page begins with an opening <html> tag and ends with a
closing </html> tag. These tags indicate that the text between them is HTML format-
ted. It tells the browser how to interpret the document.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html> an opening tag
... page information goes here
</html> a closing tag
There are two sections on a Web page: the head and the body . The head section, some-
times called the header , contains information that describes the Web page document.
Tags that are located in the head section include the title of the Web page, meta tags
that describe the document (such as the character encoding used and information that
may be accessed by search engines), and references to scripts and styles. Many of these
do not show directly on the Web page. The head section begins with the <head> tag
and ends with the </head> tag. You'll always code at least two other tags in the head
section: a <title> tag and a <meta /> tag.
The first tag in the head section, the <title> tag, contains the text that will appear in the
title bar of the browser window. This text is called the title of the Web Page and is
accessed when Web pages are bookmarked and printed. The title should be descriptive.
If the Web page is for a business or organization, the title should include the name of
the organization or business.
The meta tag is used to describe a characteristic of a Web page, such as the character
encoding. Character encoding is the internal representation of letters, numbers, and
symbols in a file such as a Web page or other file that is stored on a computer and
may be transmitted over the Internet. There are many different character encoding
sets. However, it is common practice to use a character encoding set that is widely sup-
ported, such as utf-8, which is a form of Unicode. The meta tag shown below indi-
cates that the content of the document is a Web page that uses utf-8 character
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
Search WWH ::

Custom Search