O'Reilly logo

Professional XML by Michael Kay, Kent Sharkey, Sam Ferguson, Alessandro Vernet, Bill Evjen, Thiru Thangarathinam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. XHTML and CSS

Although many people think of XML as a data format, many of the important uses for XML a re in layout. Of these, one of the most significant is XHTML, or the Extensible HyperText Markup Language. XHTML is the "XML-ized" version of HTML, cleaning up many of the sloppier features of HTML and creating a more standardized, more easily validated document format. The Cascading Stylesheets (CSS) feature, although not an XML format, is widely viewed as important for XHTML development. CSS is a formatting language that can be used with either HTML or XHTML. It is generally viewed as a cleaner replacement for the Font tag and other similar devices that force a particular view. When used in combination with XHTML, the model is that the XHTML document carries all the content of the page, whereas CSS is used to format it. This chapter looks at these two sets of specifications, as well as some validation tools that help ensure your code is valid. In addition, this chapter looks at microformats, a relatively recent set of uses for both XHTML and CSS.

Understanding XHTML

When people hear that XHTML is the XML version of HTML, the first question is usually, "Isn't HTML already XML?" or "What's wrong with HTML that it has to be XML-ized?" I hope that I'll be able to answer both these questions and more in this chapter. For those who are planning on skipping this chapter or who want the answers now, the answers are, "sort of, but not exactly" and "a few fairly major things." ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required