Head First HTML with CSS & XHTML 197
Graeme Williams writes "In the past, I've written the sort of poorly-structured non-compliant web pages that can only be produced by a combination of laziness and confusion, so I'm an ideal test subject for Head First HTML with CSS & XHTML, an introduction to building web pages which focuses on compliance with the most recent HTML 4.01 standard and XHTML 1.0 standard. The book starts with the simplest of web pages, and builds from there to a solid foundation for writing simple well-structured web sites. It's clear and thorough, and will be effective both for the complete beginner and in bringing stale skills up to date." Read on for the rest of Graeme's review.
Head First HTML with CSS & XHTML | |
author | Elisabeth Freeman & Eric Freeman |
pages | xxxv + 658 |
publisher | O'Reilly Media |
rating | 10 |
reviewer | Graeme Williams |
ISBN | 0-596-10197-X |
summary | A clear, effective and readable explanation of standards-compliant HTML, XHTML and CSS |
This is one of those cases where you can judge a book by its cover. In addition to the title and author, the cover of Head First HTML with CSS & HTML has seven tag lines, four photos and two drawings. One of the nuggets is, "A learner's guide to creating standards-based Web pages", which is a pretty good summary of the book and its intended audience.
Head First HTML is full of the sort of distractions that would normally make my skin crawl: people talking at me from the margins, mock conversations between inanimate objects (or in this case HTML tags), crosswords, quizzes and enough cute graphics to supply the kindergartens of a fair-sized city. It's clear that the authors realize that there might be some resistance to this style because they devote five pages of the introduction to explaining why they wrote the book this way – the summary of the summary is that novelty helps your brain learn. The example chapter you can download from the web site for the book is more than 50 pages, which might be enough for you to make up your own mind whether this works for you. My experience was that the method is so effective and the material so clearly presented that the issue disappeared for me after a chapter or two.
In the introduction, the authors also mention another goal: "a clean separation between the structure of your pages and the presentation of your pages". HTML or XHTML is used to provide the structure and content of a web page, and CSS (Cascading Style Sheets) are used to provide the style and layout. This means that the book doesn't include many HTML elements which are now discouraged or "deprecated", such as <B> for bold, <CENTER> for centered text, or <FONT> for specifying fonts within the web page. I guess the choice between frames and CSS might be classified as a religious one. In any case, this book is about CSS and doesn't mention frames except to note their omission in the appendix.
Most of the examples are based on a fictional coffee company called Starbuzz, and their trendy competitor, the Head First Lounge. It's a great framework for building up a web site from a few linked pages to a complete CSS layout. If you've never written a web page before, the book starts at the beginning, with the simplest web page followed by links from one page to another. If, like me, you've written a handful of web pages, reviewing the material will help focus on the essentials for a clean, compliant web page. All of the example HTML, CSS and accompanying images can be downloaded from the web site for the book, which also has the completed examples online, so you can quickly review them in your browser. If you're considering buying Head First HTML, the online examples are also a great way to see the scope of the book, from the simplest example to the most sophisticated.
There are a few prerequisites for getting the most out of Head First HTML. Adobe Photoshop Elements is used to show you how to prepare images for the web. As the book says, if you don't have it, you can download a free trial from Adobe, with the small quibble that this won't work if you've already run through your free trial before starting the book.
Understandably, Head First HTML doesn't tell you everything you might ever need to know about CSS. On the other hand, you learn a whole lot about using CSS both for appearance (such as colors and borders) and layout (positioning different parts of the page such as headers and sidebars). The book is particularly good at explaining at least some of the limitations of CSS, such as the different compromises of liquid, jello and frozen layouts. It's easily enough for you to be able to continue learning or experimentation on your own. With forgivable cuteness, the book also frequently mentions the availability of other O'Reilly publications with more information, such as HTML Pocket Reference and CSS Pocket Reference.
Similarly, the book gives a clear presentation of the different ways of setting text size, but doesn't provide the last word. If you're looking for Javascript to automatically size text based on screen resolution and browser width, you'll have to look elsewhere. In fact, Javascript is one of the ten things mentioned in the appendix, "The Top Ten Topics We Didn't Cover", leaving room for Head First Javascript to be published in 2006.
The last chapter provides a brief introduction to forms, including example designs both with and without tables. The goal of the chapter is to show you how to use CSS to style and layout forms, but you can't try out a form without something on a web server to process it, so the book's web site includes a simple-back end which will "process" (really just echo) the forms which are submitted to it.
Head First HTML deserves its score of 10, but that doesn't mean every word is perfect. I wasn't comfortable with the description of CSS borders, margin and padding until I'd gone back and re-read it. And it wasn't obvious to me that the background of a margin (such as a dashed margin) is the same as that of the content area it surrounds until I'd worked through some examples on my own. But that just underlines the fact that the book is so readable that I could tell when my understanding was slipping.
While Head First HTML never claims to be a reference, information is presented very clearly. If you forget the differences between HTML and XHTML, the book's excellent summary is easy to find, and includes a discussion of the W3C HTML and XHTML validator. That said, the index is short and idiosyncratic: there is a list of page references for the Q&A sections (under T for "There are no dumb questions") but transitional HTML is indexed only under "HTML, transitional", and jello, the layout, is found under "Design" but not "J" or "Layout".
I've said that I was initially very skeptical about the graphics-heavy Head First Labs house style. I'm pretty sure I've been thinking in prose all my life, but apparently verbal and graphical perception can be safely intermingled. I can't explain why, but this garden salad of words, pictures and diagrams of all kinds provides a easy-to-read and very effective introduction to a large amount of material."
You can purchase Head First HTML with CSS & XHTML from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
More HTML books need to talk about CSS (Score:5, Interesting)
I'm actually being forced to take a class in introductory web design. The books for this class are fairly new, yes seem to be stuck in the HTML 3.x days, with font tags, bgcolor properties, and a particular emphasis on the 216 (215?) web-safe colors.
I wish books like this one were used instead. Teaching the right way the first time is so much easier than having to tell someone that everything they learned was wrong.
Uh-oh! (Score:4, Interesting)
Can somebody say lawsuit?
As to the book itself, I looked at the sample chapter and it's in the random, jumpy style that marks the modern MTV generation. It has some appeal, but I think trying to get through a whole book laid out like that is going to cause headaches. Still, I plan to buy it, just to see if I can learn anything new.
HTML is passe (Score:1, Interesting)
I think any book that teaches CSS and XHTML more than HTML will be widely embraced by the programming community.
Head First doesn't cut it (Score:1, Interesting)
Designing With Web Standards (Score:5, Interesting)
Zeldman is also teaming up with Eric Meyers, the CSS God for An Event Apart. [aneventapart.com]
IMHO a MUCH better CSS/XHTML book... (Score:5, Interesting)
And it's cheaper [amazon.com] .
Re:More HTML books need to talk about CSS (Score:4, Interesting)
Re:HTML is passe (Score:3, Interesting)
People don't seem to understand the difference between comments and CDATA (think javascript code), almost no-one writes data into the DOM correctly with javascript (document.write() and innerHTML are wrong and makes a page no longer xhtml as the content is not written into the DOM.)
Hell I see people who can't even encode ampersands.
I like to ask them their views on html and xhtml. The correct answer isn;t to jump into bed with xhtml just because it is a buzz word, but to use the right code in the right situation. If your code isn't in a guaranteed xhtml safe environment use html (that is 95% of the time IMHO) - i've seem people putting xhtml code into pages that are written in html, and don't even have a docutype!
great book (Score:1, Interesting)
i love all "Head First
Reviewerwho? (Score:3, Interesting)
Choice between WHAT? I think you mean between CSS and tables. Or CSS+XHTML vs. Whatever HTML-like Syntax Works.
But really, there is no need to choose. I use the deprecated b tag all the time, because it is SIMPLE, love to use tables, because they WORK for displaying on various screen sizes, plus (gasp) deploy the font tag from time to time for quick prototypes. And, guess what? I also use CSS. Fact is, Firefox and IE support CSS alongside HTML elements. And so the standards.
I could care less about what is "deprecated" by W3C, as though they are going to come over and scold me, and as though I would care.
Not that great of a book for reference or learning (Score:2, Interesting)
Re:More HTML books need to talk about CSS (Score:5, Interesting)
No work around is easy. On a site with 50 different elements if it takes me ten minutes per element to figure out a work around I just spent 500 minutes making the site work in IE. That's pretty much a whole work day. If I have to do that for IE6 and IE7 now that means two work days. That is best case scenario too. Now and then I find an issue with IE that in itself takes me an entire day to work around. I'd say that for every website I produce I spend around a week just finding issues with non compliant browsers and finding work arounds. So figure it costs about $1200 per website to fix these problems. That is a lot of money when you figure I produce a dozen or more websites a year. Let's just say that in my work alone $15,000 a year is spent fixing problems with IE and that still doesn't make the websites look as good in IE as they do in Safari and Firefox. IE nearly doubles the amount of time it takes me to make a static website.
Re:Head First doesn't cut it (Score:3, Interesting)
Re:Uh-oh! (Score:5, Interesting)
As someone who has read several in the "Head First" series, this is definitely true in my experience. Most books are designed to cover a subject with little emphasis on teaching it. Head First books are designed specifically to teach you, and they go to great effort to do so. Think about it: do you retain more per hour spent watching the History Channel, or reading a dry all-text history text-book? Remember, the book can take dozens of hours to read. The text-book may provide more complete content, but that doesn't matter much if you've forgotten much of it within a few months.
You will remember what a Head First book teaches you, and you won't need the book as a reference like most text-books.
If the grandparent wants to stick to all-text, old-world books, he can go right ahead. But he should try a "Head First" book before he criticizes it.
As for his reference to the MTV generation, that is simply misplaced. Children and young adults have despised reading boring text books since the invention of the alphabet. Don't let nostalgia The difference is that today they cannot live a high quality life without knowledge. I, for one, commend innovators like Bert Bates and Kathy Sierra for making sure that there are better options for learning that is rewarding for people of nearly all ages.
Re:HTML is passe (Score:3, Interesting)
And that's a myth.
I run a website. Sections of it rely on CSS2 and don't work in IE. Instead of writing a workaround, I redirect IE users to a page that explains the problem in a few words, and gives them a link to try and look at the page anyways (this is mostly for Opera users identifying as IE).
Despite all the faked statistics claiming IE has a market share of 90%, the browser distribution on my site clearly favors Firefox (which I link to on the above-mentioned page) with almost 50%. IE is a clear second with about 40%, and the rest is Opera, Konqueror, Safari.
If I can do that to my visitors, imagine what would happen if a few major websites would do that, or something a little less radical, i.e. offering a "reduced features" version for IE users, with a box explaining the problem and pointing them to alternative browsers. My guess is that you'd see the same effect. Installing Firefox on windos is a few clicks, and a lot of people will do it if it means having one more cute picture.
Re:Hixie and XHTML Appendix C (Score:2, Interesting)
The harm comes from doing it incorrectly, not the fact that you are doing it at all.
The point is that doing Appendix C "correctly" may prove to be more work than just sniffing Accept:.
you don't necessarily have to have dynamic content to do it. Apache MultiViews handles it without needing any scripting language, you just put 'foo.html' and 'foo.xhtml' into the same directory and link to 'foo'.
And then you have to 1. try to persuade your host to turn on Options MultiViews or .var files or both, which may require dealing with seemingly impenetrable layers of red tape, and 2. generate both XHTML 1.0 and HTML 4.01 and upload them to the server, taking up twice the space in the 10 MB that your ISP, university, or free host allots you.
You still haven't addressed the differences in CSS semantics and DOM semantics between HTML 4.01 and XHTML 1.0, and you still haven't addressed the point of using XHTML 1.1 or newer. Until Microsoft Internet Explorer supports XHTML without the Appendix C hack, what's the advantage of valid XHTML 1.0 over valid HTML 4.01?