04.06.2013 Views

Head First HTML with CSS

Head First HTML with CSS

Head First HTML with CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

a checklist for xhtml strict<br />

You’re much closer to using X<strong>HTML</strong> than<br />

you might think<br />

Even though <strong>HTML</strong> and X<strong>HTML</strong> are almost the same, there are a few small<br />

differences, as you’ve seen. Here’s a handy checklist for moving from <strong>HTML</strong> 4.01<br />

Strict to X<strong>HTML</strong> 1.0 Strict:<br />

272 Chapter 7<br />

The X<strong>HTML</strong> 1.0 checklist<br />

Here’s the list of things you must do to convert from <strong>HTML</strong> to X<strong>HTML</strong>.<br />

❏ Change your DOCTYPE to Strict X<strong>HTML</strong>. Or, you can<br />

use Transitional X<strong>HTML</strong> if you’re still using Transitional<br />

<strong>HTML</strong>.<br />

❏ Add the xmlns, lang, and xml:lang attributes to your<br />

opening tag.<br />

❏ The tag must be the first tag after the DOCTYPE<br />

and the closing tag must be the last tag in the<br />

document.<br />

❏ All element names must be written <strong>with</strong> lowercase letters.<br />

❏ All opening tags must have closing tags. Or, if an element is<br />

empty, the tag must end <strong>with</strong> a space and then />.<br />

❏ All attributes must have values, and those values must be<br />

surrounded by double quotes.<br />

❏ Don’t use & in the content of your <strong>HTML</strong>. & is for starting<br />

entities, so use &amp; instead. Also convert any other special<br />

characters to entities.<br />

If you started from scratch reading this book and you’ve been diligent in using<br />

strict <strong>HTML</strong> 4.01, then moving to X<strong>HTML</strong> 1.0 is going to be fast for you.<br />

You really only have a few things you need to take care of, and we’ll talk about<br />

those next.<br />

On the other hand, if you have a lot of legacy <strong>HTML</strong> you need to convert,<br />

then you may have a big job on your hands. But, even in that case, there are<br />

some tools that can help get you there. We’ll talk about those too.<br />

We’ve checked off the<br />

requirements that you’re<br />

already on top of. So,<br />

that doesn’t leave you <strong>with</strong><br />

much to do to move to<br />

X<strong>HTML</strong> 1.0.<br />

We’re going to talk<br />

about what this means.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!