HTML and CSS Reference
Myth: (X)HTML Is the Most Important Technology Needed to Create Web Pages
Whereas (X)HTML is the basis for Web pages, you need to know a lot more than markup to
build useful Web pages (unless the page is very simple). However, don't underestimate
markup, because it can become a bit of a challenge itself. Based on the simple examples
presented in this chapter, you might surmise that mastering Web page creation is merely a
matter of learning the multitude of markup tags, such as <h1> , <p> , <em> , and so on, that
specify the structure of Web documents to browsers. While this certainly is an important
first step, it would be similar to believing you could master the art of writing by simply
understanding the various commands available in Microsoft Word. There is a tremendous
amount to know in the field of Web design and development, including information
architecture, visual design, client- and server-side programming, marketing and search
engines, Web servers and delivery, and much, much more.
The Future of Markup—Two Paths?
Having followed markup for well over a decade in writing editions of this topic and
beyond, it is still quite difficult to predict what will happen with it in the future, other than
to say the move towards strict markup will likely be a bit slower than people think and
probably not ideal. The sloppy syntax from the late 1990s is still with us and is likely to be
so for some time. The desire to change this is strong, but so far the battle for strict markup is
far from won. We explore here two competing, or potentially complementary, paths for the
future of markup.
XHTML: Web Page Markup XML Style
A new version of HTML called XHTML became a W3C recommendation in January 2000.
XHTML, as discussed earlier in the chapter, is a reformulation of HTML using XML that
attempts to change the direction and use of HTML to the way it ought to be. So what does
that mean? In short, rules now matter. As you know, you can feed a browser just about
anything and it will render. XHTML would aim to end that. Now if you make a mistake, it
Theoretically, a strictly XHTML-conforming browser shouldn't render a page at all if it
doesn't conform to the standard, though this is highly unlikely to happen because browsers
resort to a backward-compatibility quirks mode to display such documents. The question is,
could you enforce the strict sense of XML using XHTML? The short answer is, maybe not
To demonstrate, let's reformulate the xhtmlhelloworld.html example slightly by adding
an XML directive and forcing the MIME type to be XML. We'll then try to change the file
extension to .xml to ensure that the server gets the browser to really treat the file as XML data.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<meta http-equiv="Content-Type" content="text/xml; charset=utf-8" />
<title> Hello XHTML World </title>
<!-- Simple hello world in XHTML 1.0 strict example -->