CSS is not HTML; it simply means that HTML now relies on the capabilities of CSS.
The W3C's thinking is this: Style sheets should be used to "relieve HTML of the responsibilities of presentation."
Translation: Don't bug us with requests for more HTML tags to do layout. Use style sheets instead.
That's probably a good idea. It means that anybody can use HTML tags, whether she is Jo Web Designer or not. But ol' Jo can use CSS to reassign standard HTML tags to do whatever she wants them to do, for more professional results.
In addition, this means that CSS can be used with other markup languagessuch as XML (Extensible Markup Language), XHTML (Extensible Hypertext Markup Language), and even other Web technologies such as SVG (Scalable Vector Graphics) and Adobe Flashjust as easily as it can be used with HTML.
This book will focus on the use of CSS with the latest standards in Web markup languages (XHTML 1.0), but virtually all of this information can equally be applied to these other markup languages.
The latest version of the Hypertext Markup Language, HTML 4.01, was released in December 1999 by the W3C (w3.org/TR/html4/). HTML 4.01 includes the style-sheet methodology (previously maintained as a separate standard) as part of the HTML specification (Figure 1.9).
Figure 1.9. The W3C's HTML home page (www.w3.org/MarkUp/). You can find information about both HTML and XHTML here.
XML and XSL
Like HTML, the Extensible Markup LanguageXML, for short (w3.org/XML/)is an offshoot of SGML (see the sidebar "Where Did Markup Languages Come From?"). Unlike HTML, however, XML gives Web designers the ability to define not only the structure of the page, but also the types of information being presented. XML produces a Web page that works like a database and is convenient to search and manipulate, which is why XML is being touted as the greatest thing to happen to the Internet since HTML.
With XML, you can "teach" the browser how to tell the difference between the real name, the alias, and the person's organization. You can also tell the browser how each of these elements should be displayed.
XSL, which stands for Extensible Stylesheet Language (w3.org/Style/XSL/), is used to convert XML documents into other kinds of documents, such as HTML for display on the Web. This is especially useful for content destined for both screen and print, since it makes it easy to design for both.
XML and XSL may hold many promises for Web designers, but how do you get Web designers to switch from HTML, with which they are comfortable, to the more complex XML?
The answer: XHTML.
XHTML (w3.org/TR/xhtml1/) is a hybrid of the HTML 4.01 standard and XML. Many people hope that XHTML will begin a relatively painless transition from HTML to XML.
XHTML uses the XML Document Type Definitions (DTD)collections of declarations that tell the browser how to treat the structure, elements, and attributes of the tags that it finds in a document. XHTML uses all the same tags as HTML with the upshot that, although XHTML Web pages can use the strength of XML, the code will still work even if the browser does not understand XML.
If the standards are so similar, why change? The W3C offers two good reasons:
If Web designers begin using XHTML now, they can reap the benefits of XML without giving up the HTML skills they worked so long to develop. In fact, if you know HTML, you already know all the XHTML tags. The main thing you will have to learn is how these tags can (and cannot) be used. XHTML is a good deal stricter than HTML in terms of what it allows you to do, but these restrictions lead to cleaner, faster, easier-to-understand HTML code.
The Scalable Vector Graphics formatSVG, for shortis a method of creating vector graphics on the Web (w3.org/Graphics/SVG/). Like Flash, rather than plotting each point in the graphic, SVG describes two points and then plots the path between them as a straight line or curve.
Although still lagging far behind Flash in browser penetration, several browsers have included native support for SVG. Mozilla Firefox 1.5, Opera 8 and later, and Apple Safari will include it soon. Of course, the holdout is Microsoft's Internet Explorer, which apparently will not be supporting SVG anytime this decade, except through the use of a plug-in provided by Adobe (adobe.com/svg/).
Unlike Flash, which uses an editor to create its files and hides much of the code used to create the graphics, SVG uses a variation of XML to create its vector graphics. More important from a DHTML standpoint, SVG graphics can be scripted with the Document Object Model (for more information on the DOM, see Chapter 12), and can include all the DHTML capabilities described in this book.
Flash MX 2004 introduced general support for CSS, allowing designers to use the same style sheet for the presentation of both Web pages created using a markup language and proprietary Flash vector code.