Datasheet
XHTML, or Extensible Hypertext Markup Language, is a variant of HTML represented as XML (discussed
later) and is the successor to HTML, which it is now starting to replace. For maximum flexibility, most
new documents should be created with XHTML rather than HTML.
CSS, or
cascading style sheets, is a mechanism for attaching style information to HTML and XHTML
documents. Style information includes such things as font, color, and page layout information. The first
incarnation of HTML provided very little ability to specify much in the way of style information, and
decisions about how to render the document were left entirely to the browser. Before long, support for
additional HTML elements and attributes was added, so that content creators can make documents that
specify various elements of style.
<html>
<head>
<title>My Document</title>
</head>
<body bgcolor=”#FF33FF”>
<h1><font face=”Arial” size=”2” color=”#0000FF”>Welcome to My
Web Site</font></h1>
<p>
<font face=”Arial” size=”4” color=”#00FF00”>Hello, world!</font>
</p>
</body>
</html>
As you can imagine, maintenance of web sites made up of documents styled in this way was a nightmare—
every time you wanted to change a font size, for example, you would have go through each document,
changing the size attribute everywhere it occurred. This approach also increased the complexity of the doc-
ument structure enormously, resulting in a great deal of document bloat. Fortunately, CSS came along to
save the day.
CSS provides complete separation of document content and document presentation. With CSS, it is pos-
sible to take the same HTML document and present it in different ways and via different media. For
example, you might use one set of CSS to render an HTML document for the Web, and a different set to
format your document in a way that allows it to be printed easily.
Used properly, CSS can reduce document bloat enormously. For example, with CSS, the HTML above
becomes:
<html>
<head>
<title>My Document</title>
<link href=”styles.css” rel=”stylesheet” type=”text/css” />
</head>
<body>
<h1>Welcome to My Web Site</h1>
<p>Hello, world!</p>
</body>
</html>
Here is the associated CSS file:
body {
color: #00FF00;
8
Part I: Building a New Internet
05_097748 ch01.qxp 12/14/06 5:53 PM Page 8










