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:
  • Head First! (Score:5, Insightful)

    by CanadianBoy ( 868003 ) on Friday February 03, 2006 @03:38PM (#14637008)

    While I haven't read this particular Head First book, I have nothing but praise for the rest of the series.

    The 'Learner's Guide' is exactly right; they explain everything they do clearly, they make the examples and exercises fun and easy to understand, not only on what to do, but why to do it. The books are graphically appealing and funny (and it's not just nerd humor), which makes them easy to read, but at the same time they don't sacrifice information, or simplify it beyond understanding.

    Sight unseen, I would recommend this book, the same way I do their other ones.

  • Re:Uh-oh! (Score:5, Insightful)

    by kelzer ( 83087 ) on Friday February 03, 2006 @03:47PM (#14637078) Homepage

    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.

    That's what I thought, too, until I read the preface to Head First Design Patterns. Turns out that the pictures, humor, etc., have actually been proven to improve learning and retention.

  • Re:HTML is passe (Score:4, Insightful)

    by hunterx11 ( 778171 ) <hunterx11@g3.1415926mail.com minus pi> on Friday February 03, 2006 @03:53PM (#14637117) Homepage Journal
    You are thinking of the semantic web [w3.org], which is XML based; however, XHTML is not inherently semantic, just easily-parsed.
  • by DigitalRaptor ( 815681 ) on Friday February 03, 2006 @03:59PM (#14637182)
    That's probably because you design the whole thing, checking it regularly in IE, then when it's all done check it in Firefox and don't like what you see.

    In reality, FF has way better adherence to CSS standards than IE does. IE is crap. Intentionally broken crap. 5 years outdated, full of holes crap.

  • Re:HTML is passe (Score:3, Insightful)

    by Arandir ( 19206 ) on Friday February 03, 2006 @04:00PM (#14637189) Homepage Journal
    Huh? There's not much difference between HTML and XHTML. The latter is essentially just the former converted to valid XM. You have to close your tags, but that's about it.

    If you can't "harvest data" from HTML's <h1> tag, you're still not going to be able to harvest data from XHTML's <h1> tag.
  • Other markups (Score:3, Insightful)

    by MrNaz ( 730548 ) on Friday February 03, 2006 @04:00PM (#14637192) Homepage

    Given that the market at the moment is trying to squeeze as much functionality out of existing technologies and the increasing use of new markup languages such as SVG and MathML, I would have thought that more and more books would start teaching XHTML/CSS.

    XHTML will allow far better flexibility when adding in new functionality provided by new markup languages as well as better machine readability for the purposes of migrating pages at a later date. Tools to assist in developing syntactically valid XHTML pages are easily available and easy to use (such as Firefox's Validator tool as well as the old trusty http://validator.w3.org/ [w3.org]), so the argument that novices may break XHTML pages by not writing valid code is not as potent as it once was.

    The challenge now lies in teaching students to write semantically correct markup. This cannot be checked by a validator or any other machine tool, as semantically incorrect markup may still follow the rules of syntax. However, it can break a braille browser or a mobile device that degrades pages' layout for the purposes of displaying it on a small screen, rendering the information inaccessible to users of these devices.

    XHTML's stricter syntax far more strongly encourages users to think in terms of content/presentation rather than just writing a blob of HTML to show a nicely formatted essay/blog/gallery. The more information is both syntactically and semantically correct, the more the web will be a friendly place for users of devices other than PCs, or users who are accessing the web from a device designed to aid a disability.

    It is for these reasons, forward compatibility and accessibility, that I think that XHTML should start being taught. I always hear it argued, when I recommend XHTML to a would-be developer, that "XHTML is not understood" and "it breaks pages if used incorrectly". Well, help users to understand, and teach them to use it correctly.

  • Yup. (Score:3, Insightful)

    by ScentCone ( 795499 ) on Friday February 03, 2006 @04:51PM (#14637605)
    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

    I agree. They can take my <B> tag when they pry it from my cold, dead text editor.

    Really... a few nested tables work just FINE. And, if you happen to build e-commerce sites catering to a large cross-section of humanity, you'll find yourself serving pages up to people with a four-versions-ago copy of the AOL client, or Netscape 4.1, etc. They're still out there. Nice as some fancy-pants AJAX-ish stuff is for portally things or specific audiences, even some fundamental CSS things are beyond a lot of visitors' platforms, depending on your demographics.
  • by CodeBuster ( 516420 ) on Friday February 03, 2006 @05:33PM (#14637867)
    The key to understanding the market for techincal books is to realize that not everyone's time is equally valuable. You are quite correct in your assertion that all of the raw information in the book can be found on the Web for free with a few search sessions and some digging through the trash...and the web is full of bad advice and just plain wrong information, especially when it comes to web design and development where many people have conflicting opinions which they recite as factual information. That having been said the value in the technical book comes in the order and presentation of the materials, the expert (usually) peer reviewed suggestions and best practices, and the aggregation of various sources into one coherent work. All of this could be learned without spending you hard earned money by doing enough searching, digging, and reading on the web, but at the end of the day who do you want to trust....user99 the phat html h4x0|2s...or the somewhat more credible authors of these books...that and the main point which was how much is your time worth?
  • by kimvette ( 919543 ) on Friday February 03, 2006 @06:23PM (#14638305) Homepage Journal
    I really hate it when I see an HTML book that teaches things that have been deprecated in modern HTML.


    Deprecated HTML elements (and browser sniffing) will be around for as long as Microsoft refuses to fix MSIE. This includes MSIE 7.0.
  • by Anonymous Brave Guy ( 457657 ) on Friday February 03, 2006 @09:58PM (#14639555)
    On a site with 50 different elements if it takes me ten minutes per element to figure out a work around

    ...then you're in the wrong line of work.

    Seriously, we all know that IE's handling of CSS is buggy as hell, and there are plenty of bugs in other browsers, too. However, the vast majority of problems come down to the same half-dozen or so "frequent offenders", and the circumstances when they arise and the workarounds for them are widely known and readily available for the price of a search engine query. If it takes you more than a few minutes to patch up the CSS for a sensibly-designed site to make it compatible with the vast majority of browsers in use today, then you need to spend less time slagging off other people's software on Slashdot and more time reading introductory tutorials on browser compatibility.

    And yes, I have done the CSS for several moderately large web sites, and yes, they do all display correctly on all recent versions of all major browsers.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...