Although it’s not a page structure tag, the XHTML 1.0 recommendation includes one additional requirement for your web pages. The first line of each page must include a DOCTYPE identifier that defines the XHTML 1.0 version to THE DOCTYPE IDENTIFIER
Although it’s not a page structure tag, the XHTML 1.0 recommendation includes one additional requirement for your web pages. The first line of each page must include a DOCTYPE identifier that defines the XHTML 1.0 version to which your page conforms, and the document type definition(DTD) that defines the specification. This is followed by the <html>,<head>, and <body> tags . in the following example. The XHTML 1.0 strict document type appears before before the page structure tags:
<D DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 strict//EN”
“http:// www.W3,org.TR.xhtml 1/DTD/strict.dtd”>
<html>
<head>
<title>page title</title>
</head>
<body>
….your page content…..
</body>
</html>
Three types of HTML 4.01 document types are specified in the XHTML 1.0 specification: strict, transitional, and frameset. Refer to lesson 16, “writing good web pages: Do’s and don’ts,” for more information about the DOCTYPE tag, and more information about the differences between strict, transitional, and frameset document types.
THE <HTML> TAG
The first page structure tag in every HTML page is the <html> tag. It indicates that the content of this file is in the BTML language. In the XHTML 1.0 recommendation, the <html> tag should follow the DOCTYPE identifier (as mentioned in the previous note) as shown in the following example.
All the text and HTML elements in your web page should be placed within the beginning and ending HTML tags, like this:
<! DOCTYPE html PUBLIC “-//W3C //DTD XHTML 1.0 transitional //EN”
http://www.W3,org/TR.xhtml 1//DTD/transitional.dtd>
<html>
….your page…..
Before XHTML 1.0, you could play fast and lose with the tags in your documents. In order for your HTML to be valid, you needed to include the <html> tag around all the other tags in your document, but none of the popular browsers cared if you really did. If you left them out, or included the beginning <html> tag but not the closing tag, or whatever, the browser would still display the document without complaining. With XHTML 1.0, you HTML documents must also be valid XML documents require all the elements in a file to be enclosed within a root element. In XHTML 1.0 documents, thje root element is the <html> tag.
Here’s a typical example of how you properly use the <head> (you’ll learn about
<title> later):
No comments:
Post a Comment