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.

standards, compliance, and all that jazz<br />

Frank: But different browsers (say Internet Explorer versus Firefox versus<br />

Safari) have different ways of handling imperfect <strong>HTML</strong>. In other words, if you<br />

have mistakes in your <strong>HTML</strong>, then all bets are off in terms of how your pages<br />

will look in different browsers. It’s only when you don’t have mistakes that most<br />

browsers display things consistently. And when we start adding presentation to<br />

our <strong>HTML</strong> <strong>with</strong> <strong>CSS</strong>, the differences will get even more dramatic if our <strong>HTML</strong><br />

isn’t up to snuff.<br />

So, by making sure we’re, as they say, “compliant” <strong>with</strong> the “standards,” we’ll<br />

have a lot fewer problems <strong>with</strong> our pages displaying incorrectly for our customers.<br />

Jim: If that reduces the number of 3 a.m. calls I get, then that sounds like a<br />

good idea to me. After all, our customers use every browser under the sun.<br />

Joe: Wait a sec, I still don’t get it. Aren’t we compliant now? What’s wrong <strong>with</strong><br />

our <strong>HTML</strong>?<br />

Frank: Maybe nothing, but there are a few things we can to do to make sure.<br />

Joe: Like what?<br />

Frank: Well, we can start by helping the browser a bit by telling it exactly which<br />

version of <strong>HTML</strong> we’re using.<br />

Joe: I’m not even sure I know which version we’re using.<br />

Frank: Ah ha! So there is some room for improvement here. Okay, let’s begin<br />

by figuring out which version of <strong>HTML</strong> we’re using and how we can tell the<br />

browser about it. There are a few other things we need to do too, but don’t worry,<br />

this isn’t a big deal. And, when we’re done, life will be much easier when we start<br />

using <strong>CSS</strong>.<br />

?<br />

brain<br />

power<br />

Browsers all do a pretty good job of consistently displaying your pages<br />

when you write correct <strong>HTML</strong>, but when you make mistakes or do<br />

nonstandard things in your <strong>HTML</strong>, pages are often displayed differently<br />

from one browser to another. Why do you think that is the case?<br />

you are here 225

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

Saved successfully!

Ooh no, something went wrong!