Prev | Current Page 40 | Next

Charles Wyke-Smith

"Stylin' with CSS: A Designer's Guide 2nd Edition"

0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
lang="en">

A Sample XHTML Document

For a quick reference of XHTML
tags and attributes, take a look at a
listing at the Cookwood site (run by
another Peachpit author, Elizabeth
Castro, whose books I highly recommend)
at http://www.cookwood.
com/html/extras/xhtml_ref.html.
Highlighted code is the XHTML template
shown earlier in the chapter..
XHTML: GIVING STRUCTURE TO CONTENT 21








Welcome to XHTML


Good XHTML markup makes your content portable,
accessible and future-proof. Creating XHTML-compliant pages
requires following a few simple rules. Also, XHTML code
can be easily validated online so you can ensure your code
is correctly written.


Here are the key requirements for successful validation
of your XHTML code.



  1. Declare a DOCTYPE

  2. Declare an XML namespace

  3. Declare your content type

  4. Close every tag, enclosing or non-enclosing

  5. All tags must be nested correctly

  6. Inline tags can't contain block level tags

  7. Write tags in lowercase

  8. Attributes must have values and must be quoted

  9. Use encoded equivalents for left brace and
    ampersand


STYLIN??™ WITH CSS - CHAPTER 1 22
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52