CSS: The Missing Manual
Michael J. Ross writes "Ever since Cascading Style Sheets (CSS) first appeared on the Web scene in the late 1990s, a plethora of books have been written and published that purport to explain how CSS works, and how to make it work for you. So why would any publisher decide that what the technical world needs is yet another CSS book? Perhaps because they have taken a close look at the bulk of those available titles, and found them to be wanting — filled with overly theoretical explanations and sample code that is far too focused on some pet domain of the author. Such books may be adequate for the veteran Web developer, who has the time and inclination to separate the wheat from the chaff. But developers new to CSS need much more approachable material, with clear examples. Perhaps that is the thinking behind CSS: The Missing Manual." Read the rest of Michael's review.
CSS: The Missing Manual
author
David Sawyer McFarland
pages
494
publisher
O'Reilly Media
rating
7
reviewer
Michael J. Ross
ISBN
0596526873
summary
An accessible guide to using CSS with HTML.
Written by David Sawyer McFarland, CSS: The Missing Manual is published by O'Reilly Media, as part of their Pogue Press series, under the ISBN 0596526873. It first came out in August of 2006. The publisher maintains a Web page for the book, where visitors can find a link to register their copy of the book (does anyone do that?), a page for submitting errata (none yet, as of this writing), a form for posting a review on the O'Reilly site (again, be the first!), and a sample chapter (Chapter 1: Rethinking HTML for CSS) as a PDF file. There are also links for purchasing the book in the U.S. or the UK, and for reading the online version, as a part of O'Reilly's Safari service.
The book's 494 pages are organized into 14 chapters and three appendices, grouped into five parts. In addition, there is an index, as well as a terse but meaty introduction, which even includes a summary of HTML. The humor for which the Missing Manual books are known, begins early, in introduction, though in this case probably not intentionally: Page 9 claims that the book "is divided into four parts," and then lists the five parts. Before commenting upon those five-ish four parts, it should be noted that the table of contents runs seven pages, listing the book's parts, chapters, sections, and subsections. Future editions of the book would benefit from an overview table of contents, similar to those used in an increasing number of technical books, to good effect.
The 14 chapters cover most if not all of the essentials: writing HTML for CSS; creating styles and style sheets; determining what to style; using inheritance; using cascading; formatting text; setting margins, padding, and borders; styling graphics; styling links and navigation bars; styling tables and forms; creating float-based layouts; positioning page elements; creating print stylesheets; and writing maintainable CSS code. The three appendices include a CSS property reference, a discussion of CSS use in Dreamweaver version 8, and a listing of CSS resources to supplement the book.
On the positive side of the ledger, the author does a commendable job of clearly explaining all of the essential topics that the typical developer would need to understand in order to begin developing a robust Web site based on HTML and CSS, or reworking an existing site that is in desperate need of an overhaul. The clear explanations and bite-sized examples demonstrate that David Sawyer McFarland is not only an experienced Web developer, but likely has spent considerable time explaining to others how to do the same — as a writer, trainer, and instructor. This book is not his first, for he has previously written Dreamweaver: The Missing Manual.
One valuable aspect of the book under review, is that McFarland discusses how to overcome the most commonly encountered browser problems, in which Web pages employing CSS are not being formatted as one would expect and as specified in the CSS standards, by misbehaving browsers (that means you, "Internet Exploder"). Moreover, the book is also one of the first to document the significantly enhanced, long overdue, and welcomed CSS support in version 7 of the most commonly used Web browser (yes, we're still looking at you, "Browser by Bill").
The book is one in a series of many so-called Missing Manuals, whose tagline is "The books that should have been in the box," and whose Web site characterizes them as "Warm, witty, and jargon-free, [with] enough clarity for the novice, and enough depth and detail for the power user." In many respects, McFarland's latest contribution matches that description. In addition to the straightforward and yet comprehensive discussions of each topic, the author imbues his writing with a bit of humor, without overdoing it, or trying too hard, as is sometimes seen in other books covering subjects that admittedly can be quite dry.
On the negative side of the ledger, someone — or, more likely, some committee — somewhere along the decision chain, stipulated that almost every page of the book should be formatted so that the outside 1.5 inches, which is the easiest for a reader to see, should be consumed by a mostly empty and useless gutter, the bulk of which is filled with a light gray bar. This pushes the text, which slightly more than 4.5 inches wide, further in, toward the book's binding, and thus more difficult to read. This is true even though O'Reilly has wisely chosen to use RepKover, a flexible lay-flat binding. This exasperating style of layout is not characteristic of O'Reilly's books, which are generally much easier to read, with more sensible margins and often larger font.
One of the first principles taught to those learning Web design, is to avoid using white text on a black background. Such Web pages usually try to appear cool and edgy, but instead often comes off as immature in the eyes of an Internet veteran, and sinister to the Internet newbie. It doesn't work on Web sites, and it doesn't work in Web books. Sadly, O'Reilly chose to use white-on-dark-gray for many of the book's sidebars, making them difficult to read, especially as the sidebar text font size appears to be a bit smaller than that of the regular text.
In a nutshell, the content of this book is excellent, while the presentation of that content leaves much to be desired — ironic for a book focusing on CSS, whose primary purpose is to modularize and simplify presentation, neatly separating it from content. Ranking the content and presentation on a scale of 1 to 10, I would give them 9 and 5, respectively. Yet on balance, just as is true for most Web pages, the content is more important than its layout and other aesthetic considerations. CSS: The Missing Manual is a well-written, lighthearted, up-to-date, and easily accessible guide to modern CSS and how to use it in the real world.
You can purchase CSS: The Missing Manual from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Written by David Sawyer McFarland, CSS: The Missing Manual is published by O'Reilly Media, as part of their Pogue Press series, under the ISBN 0596526873. It first came out in August of 2006. The publisher maintains a Web page for the book, where visitors can find a link to register their copy of the book (does anyone do that?), a page for submitting errata (none yet, as of this writing), a form for posting a review on the O'Reilly site (again, be the first!), and a sample chapter (Chapter 1: Rethinking HTML for CSS) as a PDF file. There are also links for purchasing the book in the U.S. or the UK, and for reading the online version, as a part of O'Reilly's Safari service.
The book's 494 pages are organized into 14 chapters and three appendices, grouped into five parts. In addition, there is an index, as well as a terse but meaty introduction, which even includes a summary of HTML. The humor for which the Missing Manual books are known, begins early, in introduction, though in this case probably not intentionally: Page 9 claims that the book "is divided into four parts," and then lists the five parts. Before commenting upon those five-ish four parts, it should be noted that the table of contents runs seven pages, listing the book's parts, chapters, sections, and subsections. Future editions of the book would benefit from an overview table of contents, similar to those used in an increasing number of technical books, to good effect.
The 14 chapters cover most if not all of the essentials: writing HTML for CSS; creating styles and style sheets; determining what to style; using inheritance; using cascading; formatting text; setting margins, padding, and borders; styling graphics; styling links and navigation bars; styling tables and forms; creating float-based layouts; positioning page elements; creating print stylesheets; and writing maintainable CSS code. The three appendices include a CSS property reference, a discussion of CSS use in Dreamweaver version 8, and a listing of CSS resources to supplement the book.
On the positive side of the ledger, the author does a commendable job of clearly explaining all of the essential topics that the typical developer would need to understand in order to begin developing a robust Web site based on HTML and CSS, or reworking an existing site that is in desperate need of an overhaul. The clear explanations and bite-sized examples demonstrate that David Sawyer McFarland is not only an experienced Web developer, but likely has spent considerable time explaining to others how to do the same — as a writer, trainer, and instructor. This book is not his first, for he has previously written Dreamweaver: The Missing Manual.
One valuable aspect of the book under review, is that McFarland discusses how to overcome the most commonly encountered browser problems, in which Web pages employing CSS are not being formatted as one would expect and as specified in the CSS standards, by misbehaving browsers (that means you, "Internet Exploder"). Moreover, the book is also one of the first to document the significantly enhanced, long overdue, and welcomed CSS support in version 7 of the most commonly used Web browser (yes, we're still looking at you, "Browser by Bill").
The book is one in a series of many so-called Missing Manuals, whose tagline is "The books that should have been in the box," and whose Web site characterizes them as "Warm, witty, and jargon-free, [with] enough clarity for the novice, and enough depth and detail for the power user." In many respects, McFarland's latest contribution matches that description. In addition to the straightforward and yet comprehensive discussions of each topic, the author imbues his writing with a bit of humor, without overdoing it, or trying too hard, as is sometimes seen in other books covering subjects that admittedly can be quite dry.
On the negative side of the ledger, someone — or, more likely, some committee — somewhere along the decision chain, stipulated that almost every page of the book should be formatted so that the outside 1.5 inches, which is the easiest for a reader to see, should be consumed by a mostly empty and useless gutter, the bulk of which is filled with a light gray bar. This pushes the text, which slightly more than 4.5 inches wide, further in, toward the book's binding, and thus more difficult to read. This is true even though O'Reilly has wisely chosen to use RepKover, a flexible lay-flat binding. This exasperating style of layout is not characteristic of O'Reilly's books, which are generally much easier to read, with more sensible margins and often larger font.
One of the first principles taught to those learning Web design, is to avoid using white text on a black background. Such Web pages usually try to appear cool and edgy, but instead often comes off as immature in the eyes of an Internet veteran, and sinister to the Internet newbie. It doesn't work on Web sites, and it doesn't work in Web books. Sadly, O'Reilly chose to use white-on-dark-gray for many of the book's sidebars, making them difficult to read, especially as the sidebar text font size appears to be a bit smaller than that of the regular text.
In a nutshell, the content of this book is excellent, while the presentation of that content leaves much to be desired — ironic for a book focusing on CSS, whose primary purpose is to modularize and simplify presentation, neatly separating it from content. Ranking the content and presentation on a scale of 1 to 10, I would give them 9 and 5, respectively. Yet on balance, just as is true for most Web pages, the content is more important than its layout and other aesthetic considerations. CSS: The Missing Manual is a well-written, lighthearted, up-to-date, and easily accessible guide to modern CSS and how to use it in the real world.
You can purchase CSS: The Missing Manual from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
*all* browsers implemented it per the W3C standard.
There, fixed it for you. For everyone else, there's the W3C.
writing HTML for CSS; creating styles and style sheets; determining what to style; using inheritance; using cascading; formatting text; setting margins, padding, and borders; styling graphics; styling links and navigation bars; styling tables and forms; creating float-based layouts; positioning page elements; creating print stylesheets; and writing maintainable CSS code.
Granted, I probably learned all of this in CS101, but if I need to remember how to do something, I typically perform a google search instead of paging thru a "missing manual". But, for those that prefer paper, this looks good.
Now I know why IE has such bad CSS support. The IE team lost their copy of the CSS manual!
Now that is has been found, they can get back to work.
I was hoping for a book to help my FPS gaming :(
Here is the best manual, from W3C themselves:
http://www.w3.org/TR/REC-CSS2/
For you and others like you, there are those who read through all these manuals cover to cover, figure it all out, and answer all the forum questions so that you may "google it".
Opinion:=TMyOpinion.Create(Me);
CSS is a great idea, but doing it in practice blows because the browsers vary so much in their implementation.
The most useful thing I have found to help is QuirksMode Browser Compatability Tests. I think this guy is insane to have spent so much time testing every single feature in (nearly) every browser, but it is very, very useful to see exactly which browsers support what.
Light cup, beer drink, thin so chain, neck turtle fat, man I won't say it again
Too many CSS and Javascript books out there already.
And way too many half-baked blogs out there on both subjects as well.
Where are all the Really Good(tm) books and sites?
Mumblefuhtz...
I learned CSS by myself with several books and constant visits to w3schools.com (wonderful site. I 3 W3C!!!!). Assuming this book is what it is advertised as being, it would be a great tool for people new to CSS. I am a web designer and will not touch tables for layout purposes. It is sometimes a pain to deal with how shitty IE is, but it's worth it. Also, if you comply strictly to W3C standards and write your HTML and CSS semantically (if code was food, I'd be an organic health nut), you will have VERY few problems with different browsers displaying things differently. Let's just hope that IE 7 will like CSS more than IE 6! CSS is a wonderful thing that everybody should be using.
What about the missing standard compliancy?
perpetually dwelling in the -1 pits
As usual, Amazon has it cheaper than BN ($23.09 vs $27.99)
Expert Java EE Consulting
Dvorak already decided we don't need CSS.
What would be nice is something like Java's API or Sun's Javascript Reference for CSS. But I really don't see a need for a new book on the matter... googling "CSS" suffices. I kind of feel like this is simply an advertisement for the book. Dan
Anything can, could, and will happen.
"And the number of its parts shall be five!"
"Four, sir."
"Four!"
...following the principles of Heisenburger's Uncertain Cat...
Anyone who wants to learn CSS should just get all of the Eric Meyer titles. If you cant learn CSS from his books, then you are just too stupid to learn CSS.
"*all* browsers implemented it per the W3C standard."
Will that be before or after we get through making fun of the W3C?
# man css
No manual entry for css
Hmmm, guess they were right.
No Sigs!
Why are there so many books about DVD encryption algorithms?
Rhymes that keep their secrets will unfold behind the clouds.There upon the rainbow is the answer to a neverending story
Speaking of "more difficult to read," while I'm as big a fan of using commas as the next talentless hack, maybe this review could've done without roughly half of the little buggers that are sprinkled throughout.
I'm only wearing black until they come out with something darker.
Too many CSS and Javascript books out there already.
And as we all know, having choices SUCKS!
Seriously, how is this different from any other computer-related topic? There are zillions of Java books, only some of which are useful to you. The book that is useful to me may not be useful to you. There are Missing Manuals, Head Start, Head Rush, Visual Quickstart, Nutshell, Definitive Guide, Cookbook, Hacks, for Dummies, for Smarties, Programmer to Programmer, and many other different styles of computer books. Surely you can find some ReallyGood books somewhere in there.
Would you really only prefer that there be only one or two flavors?
Read the EFF's Fair Use FAQ
Save $4.90 by buying the book here: CSS: The Missing Manual. And if you use the "secret" A9.com discount, you can save an extra 1.57%!
The specs are all on-line.
OK, I'm joking, but it would be nice, wouldn't it?
Immature and sinister are not always bad things! (I feel I have to stand up for my white on black site, even though I'll just get flamed again).
ccalam - acoustic versions of new songs.
10x dood, U rox bro!!1
There is something easier about pulling a book off the shelf, finding the section on print stylesheets for example, and having everything about it right there on the page to reference while you are hammering away at the keyboard...
That's why I have my bookshelf where I can reach out and grab a book without getting out of my chair or leaving the desk. Occasionally I'll google for an answer but I prefer a book with a good table of contents and index, it's usually when I don't have the book or the table or index is poor when I'll google.
FalconShould there be a Law?
The reason the Windows IE had such bad CSS support was because they didn't work with the Mac IE team. IE 5 for the Mac had better css support than any Windows IE, except maybe IE 7?
FalconShould there be a Law?
Manuals are fine, but most can be replaced by the various excellent websites around - w3schools is mentioned below and I'd agree with that.
t -Voices/dp/0321303474/ref=sr_11_1/102-7311422-8694 536?ie=UTF8 and adds a lot to what's available on the site.
However for some inspiration about what CSS can do for you a trip to the CSS Zen Garden at http://www.csszengarden.com/ is worth a thousand pages of dry css scripts. The recently published book 'the Zen of CSS design' is also excellent - http://www.amazon.com/Zen-CSS-Design-Enlightenmen
The book is one in a series of many so-called Missing Manuals, whose tagline is "The books that should have been in the box,"
My internet didn't come in a box... it came in a tube!
--You will rephrase your request for me to go to hell. Goto statements are not acceptable programming constructs
But I really don't see a need for a new book on the matter... googling "CSS" suffices.
Googling for you may be fine but many of us, including me, want hardcopy. For one staring at a long screen of text hurts my eyes and others have the same problem. Two, I learn and retain better by doing. I've been looking for a good book on CSS, one with exercises. I'll then be able to read the book and do the exercises as I read. With a book I won't have to think about eye strain or switching between windows. Simply, I much prefer hardcopy. Oh, and yes I have several websites on CSS bookmarked, though I rarely use them.
FalconShould there be a Law?
I love chapter 13 of this book, which explains how to nest span tags to display tabular data. Finally, web 2.0 is here.
...provided you remember to pack your SPF100 sunblock and plenty of water.
Must be nice to not have to maintain public-facing pages for a large company
Yes, it is quite nice not have to maintain such a site, since most "public-facing pages for a large company" are notoriously and unnecessarily complicated and standards-broken. Furthermore, it is false to say that these sites are broken becasue they must cater to IE. It is in fact the other way around--IE is broken because of the incompetence or (false) laziness, impatience and hubris of the designers and maintainers of these big public sites. MS is to blame for applying sinister "embrace and extend" strategies to its product, however by far the primary responsibility for the current messy state of affairs lies squarely with the codemonkeys who vomit forth the tag soup that all too often continues to pass for web pages today.
Let me explain: when then-leading Netscape introduced nonstandard extensions to HTML, or incorrectly or poorly implemented the standard, rather than report it as a bug web authors actually EMBRACED these quirks rather than working around them or otherwise ignoring them. For example, early web developers heavily abused non-semantic and sometimes annoying proprietary tags like CENTER and BLINK, and went as far as to do atrocious things like nest their content in multiple BODY tags with different BGCOLOR attributes to do useless crap like fading and flashing the screen. The result of this was to not only let Netscape neglect bugs, put to put pressure on Netscape to RETAIN the bugs so as to remain "compatible" with such perverse tag soup!
The phenomenon proved to be viral--in the interests of matching leader Netscape's "feature" set, Microsoft went ahead and emulated all that malarky on purpose in IE! Furthermore, MS realised that nonstandard extensions were rather easily embraced by stupid lazy tag soup codemonkeys. This was a great opportunity to embrace and extend the WWW with such atrocities as ActiveX OBJECTs and heavy promotion of CSS-like styles long before the CSS standard was established. The latter action was particularly incideous because it allows MS to say that they "support standards" when in fact they sabotage them. Rather than warning web authors to use caution with stylesheets until the CSS style was standardised, they went ahead and made sure it was getting well established so that when changes were made to their proposal for CSS was modified by the W3C. By doing that they ensured that their own inconsistent application of CSS would be the de-facto standard and they could let slide any fixes to *actually* follow standards.
So please, make your best effort to break this evil cycle and do NOT design for IE. This doesn't mean that you should let your site break IE or make it look crappy--what it means is do NOT use IE during development without regard to standards then worry about degrading gracefully in other browsers. Instead use FF or another more compliant browser during development, and regularly validating your code using the W3C validation tools. THEN, when you test against IE (this is the real world, so you can't ignore it as the grandparent post implies) you make sure it degrades GRACEFULLY in IE, and do it WITHOUT relying on sneaky CSS bugs and breaking standards.
Yes, you CAN write totally valid XHTML and CSS that looks attractive and retains enough functionality in IE to satisfy your audience. Here are some approaches I have taken in the past:
* Avoid the use of CSS features that are standards but not widely implemented in IE or other mainline browsers, at least for important presentational aspects (anything more than eye candy).
* Do NOT strive to make the page appear or function fully and exactly the same in IE as other browsers--just make sure it doesn't look "broken" in IE. MS has deliberately "dumbed down" their pages for non-IS browsers in the past (even when other browsers were perfectly capable of handling the page as designed for IE). Given
I guess users of the O'Reilly Safari online-service have to wait for this to become available..
Remember, there are no stupid questions. But there are a lot of inquisitive idiots.
Not related to the book, but it's a CSS question after all.
I have 3 divs. A main div which encloses the other 2. One is floated to the left, one to the right.
If i don't set a height on the container div, on firefox the divs will grow out of the bottom border of the div, but on IE6 the container grows automatically. OK, i just set overflow:auto to the container div and both browsers work fine.
But, if i put content to the left div, and use the right div for images and such, the right div wont grow to match the left div's size.
Is there a way to do this? Besides faking it by using the same background color and such...
Note: example code is over at Google Groups
Open Source Java Web Forum with LDAP authentication
Ever since Cascading Style Sheets (CSS) first appeared on the Web scene in the late 1990s, a plethora of books have been written and published that purport to explain how CSS works, and how to make it work for you.
So then this isn't the "missing" manual, it's a "new and improved" manual.
The theory of relativity doesn't work right in Arkansas.
...for CSS and web standards. It's really for the practical developer. You can check out my review of the book here.
Hope that helps.
Need a color? Try 100 random colors
Do you have a link or more info on this non-semantic div fix for IE's box model? Thanks again!
What's wrong with using TABLE for tabular data? Do you also use some kind of SPAN.header instead of H1?
The w3c should never have handed out "w3c compliant" logos for authors to stick on their web pages.
they should have handed them out to web browser (versions) to stick on their download pages.
If you don't risk failure you don't risk success.
IMHO, not enough web developers know about the these lovely 832 bytes of JavaScript that make my life 20x easier:
http://rafael.adm.br/css_browser_selector/
Need to adjust a width for IE only but don't want to completely redo all the CSS you've done so far? .ie #wrap becomes an IE-only selector. It's flawless thus far...
I don't recommend becoming too dependent on this kind of trickery. I first do valid mark-up, then apply CSS, debug across browsers, _then_ if something just absolutely won't work well in browser X and it's not worth the time to retrace my steps, I throw in this javascript, make my selector, and move on. Nice and future-proof too: when IE7 comes out and fixes issue Y, just knock out the selector from the CSS and get on with your life.
eric http://www.ericdfields.com/
A better book on CSS differs little from a great manual on how to hand-crank a Model T Ford. WYSIWYG was invented in the 1970's. Layout using Wysiwyg tools has its problems, but CSS seems to solve none of them. (Maybe one, but I don't know which one).
The tragedy is that I really need a better book on CSS.
Hand-coded CSS seems to be hanging on mainly because people still need to hand-code HTML, even though that should be WYSIWYG too. And hand-coded HTML seems to be hanging on mainly because of mixin-languages like PHP which enable database integration. Word processors usually don't need database integration. Note that Microsoft went to great lengths to allow people to embed live spreadsheets into Word docs, a feature that has been widely ignored. Still, it's past time for web design to leave explicit hand-coding behind. Or else what's all this Computer Science for?
I18N == Intergalacticization
Leading post sez:
On the negative side of the ledger, someone -- or, more likely, some committee -- somewhere along the decision chain, stipulated that almost every page of the book should be formatted so that the outside 1.5 inches, which is the easiest for a reader to see, should be consumed by a mostly empty and useless gutter, the bulk of which is filled with a light gray bar.
I sez:
I can't judge the design not having seen it with my own eyes, and cannot speak to the light grey bar at all, but the wide outer margin is a common design when one might be expected to make notes in the margin.
I know, I sort of trained myself never to write in books and I'm sure that is a practice many reading this follow. But the other night, I had a question about something I was reading, and I had no other paper around, so I made a note about the text in context over to the side.
Often, the bare outer design is often used by the authors themselves for illustrations and side bars. And a bar of color along the side is often used like a thumb index to delineate chapters. There are purposes for design elements, including negative space, towards a books outer margins.
Aside from fixing the browsers, that is. We could create a WYSIWIG front end for generating xhtml and css. Put the intelligence in there to generate the hellacious hacks in the code. Have it generate different stylesheets to be used by different browsers. When new bugs come out just update the app. There are plenty of WYSIWIG apps out there for making web pages that could be upgraded this way. Nvu is the first to come to mind.
If you're using a server-side framework like ASP, PHP, ROR or mod_perl, the front end could easily generate the browser detection code to choose which stylesheet to be used on a per browser basis. There are only a small number of these frameworks in use, less than 10 cover over 95% of the web pages, I'm sure.
We don't hand-generate machine-code anymore, why should we hand-generate CSS, or HTML?
I18N == Intergalacticization
"I have a truly marvelous stylesheet that solves all of IE's CSS problems, alas which this margin is too narrow to contain.
It doesn't mean much now, it's built for the future.
linen, and hempen paper for books.
Same here, and not just for books but for writing and printing. I'm not sure about rag but there are linen and hemp papers available for writing and some specialty shops have linen paper for printers though I don't know if they have any hemp paper that can be used in printers.
FalconShould there be a Law?