Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Book Reviews Books Media

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&quot, 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.
This discussion has been archived. No new comments can be posted.

Head First HTML with CSS & XHTML

Comments Filter:
  • by VGPowerlord ( 621254 ) on Friday February 03, 2006 @03:30PM (#14636944)
    I really hate it when I see an HTML book that teaches things that have been deprecated in modern HTML.

    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)

    by Billosaur ( 927319 ) * <wgrotherNO@SPAMoptonline.net> on Friday February 03, 2006 @03:37PM (#14636999) Journal
    Most of the examples are based on a fictional coffee company called Starbuzz

    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)

    by ravee ( 201020 ) on Friday February 03, 2006 @03:37PM (#14637002) Homepage Journal
    HTML has got serious faults - the major one being the softwares unable to harvest the data inteligently from the web page created using HTML. This was IMHO why a new standard (much more strict) based on XML was developed which is called XHTML.

    I think any book that teaches CSS and XHTML more than HTML will be widely embraced by the programming community.
  • by Anonymous Coward on Friday February 03, 2006 @03:42PM (#14637050)
    I bought a head first serious Java book on recommendation of one of my instructors a while ago. I ordered it online, and as soon as it arrived and I cracked the cover I regretted my decision. The style tries to be cute and 'cool', but is really very annoying and uninformative instead. I assume this trend holds true for the rest of the 'head first' series of books. Its not a series that I will be purchasing again to say the least. ;)
  • by Ranger ( 1783 ) on Friday February 03, 2006 @03:51PM (#14637103) Homepage
    Skip the review. Read Zeldman's awesome Designing With Web Standards. [zeldman.com] It will change your life. At least until you read the next life changing book.

    Zeldman is also teaming up with Eric Meyers, the CSS God for An Event Apart. [aneventapart.com]
  • by goldspider ( 445116 ) on Friday February 03, 2006 @03:59PM (#14637183) Homepage
    Designing With Web Standards [zeldman.com] by Jeffrey Zeldman [zeldman.com].

    And it's cheaper [amazon.com] .
  • by MikeFM ( 12491 ) on Friday February 03, 2006 @04:02PM (#14637212) Homepage Journal
    I agree. I work quite a bit with students who've just been taught HTML by their schools and they really are taught nothing about CSS. These are comp sci and graphic arts students for which web developing is a major job skill and they know next to nothing about CSS. They certainly aren't being taught to do anything advanced and most still use out-dated HTML when CSS would work better. A lot of things I do all the time they simply think you can't do. Pretty limiting.
  • Re:HTML is passe (Score:3, Interesting)

    by Freexe ( 717562 ) * <serrkr@tznvy.pbz> on Friday February 03, 2006 @04:02PM (#14637213) Homepage
    It's a shame that most people who code xhtml have no idea about the specs and create hideously invalid pages. It's like people don't care about character encoding and it can make site completely invalid very quickly. How many pages become invalid if I submit a ࣠to a form for preview?

    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)

    by wwmedia ( 950346 ) on Friday February 03, 2006 @04:10PM (#14637271)
    i actually bought this book, its very good as a reference

    i love all "Head First .." series books
  • Reviewerwho? (Score:3, Interesting)

    by DysenteryInTheRanks ( 902824 ) on Friday February 03, 2006 @04:14PM (#14637307) Homepage
    I guess the choice between frames and CSS might be classified as a religious one.

    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.

  • by Webapprentice ( 608832 ) on Friday February 03, 2006 @04:23PM (#14637379)
    I had that book. It spends a lot of pages advocating why you should design with web standards and the history of bad web design, but it really doesn't provide reference information or many useful examples. The book is more about advocacy and "ranting" than a reference book, so keep that in mind.
  • by MikeFM ( 12491 ) on Friday February 03, 2006 @05:06PM (#14637658) Homepage Journal
    If you want to do anything besides change your font color with CSS then IE has severe bugs. It certainly makes it hard to place blocks in the right places and at times impossible to get the same effect in IE that you can in Firefox or Safari. About the best you can do is find a workable half-assed solution for IE that leaves 70% of your site's users unable to experience the site in the most effective way. IE7 does seem to fix some of the bugs but not all of them which leaves me having to support yet another half-assed variant as IE7 once again isn't standards complaint in even the important elements of CSS2 but also doesn't render pages the way IE6 does. That'd be less of a problem if they'd release IE7 for older versions of Windows but as they don't plan to that means we'll be supporting IE6 for years too.

    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.
  • by CodeBuster ( 516420 ) on Friday February 03, 2006 @05:21PM (#14637769)
    In my experience, the main difference between the Head First series of books and other lame publishers who are trying to be cute to increase sales is that the Head First approach includes these graphics for specific reasons to enhance the ability of the human brain, which evolution has hard-wired to discard almost all information that it deems not immediately useful to your continued survival (which is just about everything the clutters our lives in daily modern life), to understand and retain information that would otherwise require multiple readings and study sessions to convince (i.e. force) your brain to understand that you really do want to remember this stuff. The head first approach is based upon extensive research into the neurobiology of learning done by Academia over the past several decades in an attempt to teach you the information that you want to learn (you bought the book after all so you presumably want to learn more about the topics that the book purports to teach) and help you retain it with the minimum amount of re-reading, studying, and general frustration. If you don't like this approach then by all means buy the traditional textbook style presentation instead...its your money after all, but I wanted to point out that the Head First style is not trying to be cutesy or funny just for the hell of it but to help you learn the material better and for that they deserve some credit.
  • Re:Uh-oh! (Score:5, Interesting)

    by Excelsior ( 164338 ) on Friday February 03, 2006 @06:05PM (#14638111)
    Turns out that the pictures, humor, etc., have actually been proven to improve learning and retention.

    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)

    by Tom ( 822 ) on Friday February 03, 2006 @06:41PM (#14638468) Homepage Journal
    Of course, without Internet Explorer support, this is basically useless,

    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.
  • by tepples ( 727027 ) <tepplesNO@SPAMgmail.com> on Friday February 03, 2006 @07:22PM (#14638773) Homepage Journal

    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?

One man's constant is another man's variable. -- A.J. Perlis

Working...