HTML Mastery

4 comments | Posted: 16 April 07 in Books, by Nathan Smith

HTML Mastery HTML Mastery is a great book, ‘nuff said. I know, you’re probably thinking “But it’s a book about HTML, who cares? CSS is the hip topic nowadays.” Yes, CSS is super-cool and lets you say things like “tables stink” with impunity, but visual style is only as effective as the underlying foundation. Given the choice, would you rather an architect first focus on building your house or painting it?

If you’re serious about web design and development, hopefully you realize the importance of HTML. Before any of the other niceties of the modern web: CSS, JavaScript, Flash, PHP or Ruby on Rails, there was HTML and it was good. Then along came all the muck which we are just now getting away from with the dawning of Web Standards. The author of this book, Paul Haine has done well in calling us back to the roots of good, semantic markup.

He begins with the basics, making sure that foundational vocabulary is covered, so that we’re all on the same page. This is paramount when working in a team environment, lest you confuse the title tag with the title attribute or some other such craziness. It seems trivial, but really speeds things up when everyone is able to dialog and understand each other. Here’s a choice quote from page 5 about the alt attribute (more on that here).

If there is one thing I want people to take away from this book, it is this: there is no such thing as an alt tag.

He also covers all of the nit-pickiness around the now tired argument of HTML vs. XHTML. What it comes down to is that he and I are of the same opinion, that XHTML 1.0 Strict served as text/html is the way to go for the time being, at least until Internet Explorer supports application/xhtml+xml (IE7 still doesn’t). On page 13, he says:

My personal preference is to write XHTML served as text/html… I also prefer the structure, knowing that I must close all of my tags and that I must quote all of my attribute values. I can do all of this in HTML if I choose, but with XHTML there’s the element of compulsion that I believe helps me write better markup.

In the appendix, he also warns against the temptation to use XHTML 1.1 because it’s the latest and greatest. Doing so without knowing why can actually be a hindrance to the aspiring web coder. On page 198, he says:

If you’re writing XHTML 1.1 but serving it as text/html, don’t fool yourself into thinking that you’re being more advanced than if you were writing any other version of (X)HTML – you’re not. At best, you might be fooling some clients or managers. After all, 1.1 is a higher number than 1.0, so it must be better, right? Sorry, but no, not really – served as HTML, XHTML 1.1 is no better or worse, and it becomes again an issues of how well you write it rather than any inherent strengths and advantages.

He also talks about the inherent caveats of serving your pages as XML vs. text/html, namely that several aspects of JavaScript, that are specific to HTML, will cease to work. Things like document.* and getElementById go out the window, and the body tag no longer receives any special treatment. Even if you are serving HTML or XHTML as text/html, you should be aware that directly styling the html tag can be hazardous. On page 16, he says:

Note that it is possible to style the html element in your CSS as you would style any other element; however, this can sometimes yield unpredictable results… styling html can cause browsers to treat the body element differently – as a div rather than as the body.

Once all of those subtle nuances are covered, he gets into the more practical realm: data tables, forms, lists, CSS and JavaScript tips. There is even a fairly comprehensive look at Microformats – hCard, hCalendar, hReview, XFN, rel-nofollow, rel-license, etc. It is all quite fascinating, how the use of these formats can get us one step closer to a true Semantic Web. Even Bill Gates acknowledges their importance. You might also be interested to know that there is a Microformats book out as well. I will write a review of it eventually.

I digress, back to the topic of HTML Mastery. In my opinion, it is not an issue of whether or not you need to know the contents of this book (you do), but rather – how far can a web designer or developer go without knowing the fundamentals? It’s like kid who learns basketball just by playing pickup games. Bad habits work for awhile, but if you want to play professionally, you need to have a proper jump-shot. This book ranks right up there with CSS Mastery as a must-have for those who are serious about web design as a career.

Discuss This Topic

  1. 1 Robert

    Good review Nathan. I just purchased the Microformats book from Friends of Ed. It looks to be a good read.

  2. 2 Nate Klaiber

    Great review Nathan. I found this book to be a very thorough book on HTML – something I haven’t found with the other books. This book really helps you build the structure and a strong foundation with your code – all the while addressing issues like HTML/XHTML that sometimes aren’t talked about as much. He brings a wealth of knowledge and information to the table – that even the seasoned HTML coder would learn something (or at least gain some insight).

    And the new microformats book is incredible as well, so everyone should buy them both at the same time – seriously. HTML Mastery just touches the base of Microformats – where the new book gets down and dirty with the specifics. As HTML progresses, I don’t see a reason to not use microformats (it’s not a new language – its just using your existing markup and still keeps everything semantic).

    Anyway, I like your analogy of a basketball player too. I get annoyed seeing people who don’t have a proper form with their shot, then complain when they aren’t accurate or consistent (learn the basics…).

    I digress now…back to work :)

  3. 3 Nathan Smith

    Nate: Yeah, I know exactly how you feel. If I had a nickel for every botched implementation of Hoverbox that I received an email about, I’d be rich.

  4. 4 Lance Fisher

    Nice review, and good point about having a technical vocabulary. As in math, having a good vocabulary of programming terms is essential to discourse. It is a huge pet peeve of mine to try and talk about programming with programmers who don’t have a proper grasp on discussing it.

    Also, I had wondered about the pitfalls of styling the html element. I remember reading somewhere about people doing it. They were wondering the same thing.

    All and all it looks like a great book. I’ll have to pick it up one of these days. I just have so many others to read…


Comments closed after 2 weeks.