Wednesday, January 6, 2010

Section 6.1. A Brief History of HTML










6.1. A Brief History
of HTML



HTML 1.02.0

HTML 3

HTML 4

These were the early days; you could fit everything there was to know about HTML into the back of your car. Pages weren't pretty, but at least they were hypertext enabled. No one cared much about presentation, and just about everyone on the Web had their very own "home page." Even a count of the number of pencils, paperclips, and Post-it notes on your desk was considered "Web content" back then (you think we're kidding).

The long, cold days of the "Browser Wars." Netscape and Microsoft were duking it out for control of the world. After all, he who controls the browser controls the Universe, right?


At the center of the fallout was the Web developer. During the wars, an arms race emerged as each browser company kept adding their own proprietary extensions in order to stay ahead. Who could keep up? And not only that, back in those days, you had to often write two separate Web pages: one for the Netscape browser and one for Internet Explorer. Not good.

Ahhh... the end of the Browser Wars and, to our rescue, the World Wide Web Consortium (nickname: W3C). Their plan: to bring order to the Universe by creating the ONE HTML "standard" to rule them all.


The key to their plan? Separate HTML's structure and presentation into two languages a language for structure (HTML 4.0) and a language for presentation (CSS) and convince the browser makers it was in their best interest to adopt these standards.


But did their plan work?


Uh, almost... with a few changes (see HTML 4.01).

1989 1991

1995

1998



Our goal in this chapter is to get ourselves up to HTML 4.01
.


Starting in Chapter 7, our goal is to be faithful to XHTML
1.0. As always, the world keeps moving, so we'll also talk later in the book about where things are going.


HTML 4.01

XHTML 1.0

????

Ah, the good life. HTML 4.01 entered the scene in 1999, and is the most current version of HTML. While everyone hoped 4.0 would be the ONE, it's always the case that a few fixes are needed here and there. No biggies and nothing to worry about.


Compared to the early days of HTML (when we all had to walk barefoot in 6 feet of snow, uphill both ways), we were all cruising along writing HTML 4.01 and sleeping well at night knowing that almost all browsers (at least the ones anyone would care about) are going to display your content just fine.

But, of course, just as we were all getting comfortable, new technologies were created and things changed. HTML and another markup language known as XML got together, and sooner than you can say "arranged marriage," XHTML 1.0 was born. XHTML inherited traits from both parents: popularity and browser-friendliness from HTML, and extensibility and strictness from XML. What does that mean? You'll find out soon enough, because we're going to have you creating XHTML Web pages before you can say "Extensible Hypertext Markup Language." Well, at least in the next chapter.

And what will happen in the future? Will we all be going to work in flying cars and swallowing nutrition pills for dinner? Keep reading to find out.

1999

2000

 




6.1.1. The Browser Exposed


This week's interview: Why do you care which version of HTML you're displaying?


Head First: We're glad to have you here, Browser. As you know, "HTML versions" have become a popular issue. What's the deal with that? You're a Web browser after all. I give you HTML and you display it the best you can.


Browser: Being a browser is tough these days... there are a lot of Web pages out there and many are written with old versions of HTML or with mistakes in their markup. Like you said, my job is to try to display every single one of those pages, no matter what.


Head First: So what's the big deal? What does it really matter which version of HTML I use?


Browser: Remember the browser wars? All kinds of elements were added to HTML that we aren't supposed to use anymore. But some people expect us browsers to be able to display them anyway, and we don't always agree on how that should be done.


Head First: Why aren't we supposed to use those elements any more?


Browser: Well, before CSS was invented, HTML had elements that were there for presentation, not structure. Now, with CSS, we don't need those anymore, but there are still plenty of Web pages out there that use them.


Head First: I think I'm starting to see the problem. So how do you manage to display all these pages in all these different versions of HTML? That's quite a tall order.


Browser: Yeah, like I said, it's tough being a browser. What we end up doing is having two sets of rules for displaying Web pages: one for old HTML and one for the newer, standard HTML. When I use the old rules, I call that my "quirks mode
" because there are so many weird things that can happen on those pages.


Head First: That sounds like a pretty good solution to me...


Browser: Well, it can get you into trouble, though. If you're writing new HTML, but you don't tell me you're writing new HTML, then I have to assume you're writing old HTML, and go into quirks mode just in case. And you don't want that.


Head First: What do you mean?


Browser: Not all browsers agree on how to display the older stuff, but we all do a pretty consistent job with standard HTML. So if you're using standard HTML, tell me and you'll get more consistent results in all browsers.


Head First: Oh, so you can end up using the quirks mode rules on the pages written using new HTML?


Browser: Exactly. If I don't know you're writing new HTML, I go into my quirks mode and do the best I can. But, you don't want that because all those "quirks" mean that your pages might end up looking a bit off, when they could have looked beautiful if I'd only known you were using new HTML.


Head First: Ahh. So, what's the solution to this mess? We definitely want our Web pages to look good.


Browser: Easy. Tell me up front which version of HTML you're using. That way I know which rules to use to display your page.


Head First: Got it. Thank you, Browser!













No comments: