DOCTYPE tag
body tag
head tag
title tag
TAG: html
<html> ... </html>
The
html
tag informs the browser that this is an HTML encoded program. The
html
opening and closing tags delimit the start and stop of the document.
The only tag that can precede the opening
html
tag is the
DOCTYPE
tag. It is used to select the XHTML DTD (Document Type Definition) that sets the rules and syntax for the XHTML document.
A well-formed XHTML document must contain properly nested and closed
html, head, title,
and
body
tags.
Although it is not a requirement, it is strongly recommended that the opening
html
tag contain information defining the language being used for both the XHTML document and for XML. This is set respectively with the
lang
and the
xml:lang
attributes. In addition, the
html
tag should also contain the XML namespace declaration (
xmlns
). This is demonstrated for English with the following code.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng">
The separate closing tag is mandatory.
Attributes and Events
dir
lang
This example demonstrates the basic structure of an XHTML program.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="eng"
>
<head>
<title>DevGuru XHTML html Tag Example</title>
</head>
<body>
<html>
body content goes here...
</body>
<
/html
>
Output:
body content goes here...
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information