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.

See, piece of cake.<br />

The DOCTYPE is in our<br />

pages and working fine.<br />

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

Jim: Yeah, really easy. But here’s what I still don’t get: we put this<br />

DOCTYPE at the top of our file to tell the browser our page is <strong>HTML</strong> 4.01<br />

but that doesn’t ensure that the file really is <strong>HTML</strong> 4.01. We could have<br />

made a mistake. So what’s the point?<br />

Frank: You’re right, because your promise to the browser is only good if<br />

you actually have written perfect <strong>HTML</strong> 4.01. That’s what I was going to<br />

get to next. What we can do is make use of a free online service that can<br />

look at a page and tell us if it’s compliant.<br />

Jim: Really? How does that work?<br />

Frank: Well, this service first looks at the document type and then checks<br />

all your <strong>HTML</strong> and makes sure it’s actually correct... like checking to make<br />

sure you’re spelling your tag names right, your elements are nested properly,<br />

that your inline elements are inside block elements and so on. It’s called a<br />

validator.<br />

Jim: Wow, and this is free? Who provides this service?<br />

Frank: The guys who came up <strong>with</strong> the standards. They’re called the<br />

World Wide Web Consortium, or W3C for short.<br />

Jim: This sounds like the answer to writing compliant <strong>HTML</strong>. But how do<br />

I know all those things you just mentioned, like what elements go inside what<br />

elements?<br />

Frank: Let’s check out the validator first and then we’ll come back to that...<br />

you are here 233

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

Saved successfully!

Ooh no, something went wrong!