HTML and CSS Reference
In-Depth Information
<p>
Soon you will
♥
using HTML.
</p>
<p>
You can put lots of text here if you want.
We could go on and on with fake text for you
to read, but let's get back to the topic.
</p>
</body>
</html>
O
NLINE
http://htmlref.com/ch1/html5helloworld.html
In the case of XHTML, which is a form of HTML that is based upon the syntax rules of
XML, we really don't see many major changes yet in our example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
Hello XHTML World
</title>
<!-- Simple hello world in XHTML 1.0 strict example -->
</head>
<body>
<h1>
Welcome to the World of XHTML
</h1>
<hr />
<p>
XHTML
<em>
really
</em>
isn't so hard either!
</p>
<p>
Soon you will
♥
using XHTML too.
</p>
<p>
There are some differences between XHTML
and HTML but with some precise markup you'll
see such differences are easily addressed.
</p>
</body>
</html>
O
NLINE
http://htmlref.com/ch1/xhtmlhelloworld.html
The preceding examples use some of the most common elements used in (X)HTML
documents, including:
• The
<!DOCTYPE>
statement, which indicates the particular version of HTML
or XHTML being used in the document. The first example uses the strict 4.01
specification, the second uses a reduced form for HTML5 the meaning of which
will be explained a bit later on, and the final example uses the XHTML 1.0 strict
specification.
• The
<html>
,
<head>
, and
<body>
tag pairs are used to specify the general structure
of the document. The required inclusion of the
xmlns
attribute in the
<html>
tag is
a small difference required by XHTML.
• The
<meta>
tag used in the examples indicates the MIME type of the document and
the character set in use. Notice that in the XHTML example, the element has a trailing
slash to indicate that it is an empty element.
• The
<title>
and
</title>
tag pair specifies the title of the document, which
generally appears in the title bar of the Web browser.
• A comment is specified by
<!-- -->
, allowing page authors to provide notes for
future reference.