CSS Pocket Reference
Michael J. Ross writes "For Web developers who appreciate the value of separating Web content from its presentation, Cascading Style Sheets (CSS) has proved a godsend, because it allows all of the styling of a Web site to be organized in CSS files separate from the site's semantic content, in HTML files (possibly dynamically generated). Yet to make this styling power possible, CSS must incorporate a long list of syntax elements, including hundreds of selectors, properties, and values. Thus it can be quite handy for the developer to have on hand a concise summary of CSS, such as the CSS Pocket Reference, authored by Eric A. Meyer." Read on for the rest of Michael's review.
CSS Pocket Reference, 3rd Edition
author
Eric A. Meyer
pages
168
publisher
O'Reilly Media
rating
8/10
reviewer
Michael J. Ross
ISBN
0596515057
summary
A concise reference book for CSS.
The book was published by O'Reilly Media on 5 October 2007, under the ISBNs 0596515057 and 978-0596515058. CSS itself has evolved along with other Web technologies, and this book is now in its third edition, having been updated to reflect the ongoing changes in CSS; the book now covers CSS2 and CSS2.1. On the book's Web page, O'Reilly offers an online table of contents, as well as ways for the visitor to view and submit errata (none as of this writing) and reviews for the book. Unlike most technical publishers, O'Reilly now makes available previews of their books' contents, in the form of a table of contents with links to the first few paragraphs of each section, including tables and illustrations.
Despite the growth in the number of elements in CSS, and the attention paid to each one of them by the author of CSS Pocket Reference, the book is still small enough to fit in a pocket, at only 168 pages. The book's material is organized into 18 unnumbered sections, preceded by some notes on the book's typographical conventions, and followed by an essential index. The bulk of the material is found in the Property Reference section. Other sections explain how to add styles to HTML and XHTML pages; CSS rule structure and style precedence, including inheritance and the cascade; element classification and display roles; visual layout; rules on floating and positioning; and table layout. Subsequent sections cover CSS value types and units, and selectors, including some of the newest additions to CSS, such as the adjacent sibling selector and the language attribute selector. Just before getting into the details on properties, Eric Meyer discusses pseudo-classes and pseudo-elements, which have made it possible for Web developers to create rather robust and attractive site navigation using CSS exclusively, without any need to resort to images and JavaScript for rollover effects and other navigation eye candy.
For each element of CSS that is covered in all of the sections mentioned above, the types of information presented to the reader can vary, depending upon the category of element. But they generally include the element's possible values, a default value, what elements it can apply to, whether it is inherited, its computed value, a brief description of the element, at least one example illustrating its usage, what browsers support it, and oftentimes a note on its usage. Consequently, this new edition of the book, like its predecessors, should prove more than adequate for most CSS reference needs.
As with any computer book, there are several ways in which this one could be improved. Any reader using the book to look up a particular element, has two possible ways of doing so: They could first consult the index, and, assuming the element is listed there, go straight to the page indicated. But most readers, knowing that the elements in each section are listed alphabetically, will probably open up the book near the front or the back, and begin flipping backward or forward, respectively, hoping to spot the element of interest as quickly as possible, given its alphabetical ordering. That individual will likely immediately spot an obvious problem with the book: The pages have no running titles (the words that indicate the first element discussed on that page, and typically listed at the very top of each page). Inclusion of such running titles in the next edition of the book, would make it much faster to use.
Another valuable addition would be some sort of table listing all of the CSS elements and their level of support within the most commonly used Web browsers and, in the case of Internet Explorer, the most commonly used versions of the browser. Also, on page 48 of the book, at the beginning of the Property Reference section, it has a subhead of "Visual Media," which suggests that there are other subheads within that section, for other media types; but I was unable to find any.
All of these problems concern the publisher's choice of material. My last criticism concerns the layout of that material in the print version of the book. Because this diminutive volume has narrow pages, and they are tightly glued together in the binding, it is imperative that the publisher of such a book provide plenty of white space in the inner margins (those closest to the binding), so the reader does not have to crack open the book too much in order to read the text closest to the binding. Repeatedly opening up the book far enough to read those inmost words, will over time weaken and eventually destroy the binding. In contrast, a small reference book like this has no need for much outer margin. Sadly, O'Reilly got it backwards with this volume, with relatively wide and useless outer margins, and inadequate inner margins.
Aside from the aforementioned flaws — all of which can be remedied in the future — CSS Pocket Reference is a compact and neatly organized gem of a book, packed with information of value to busy Web programmers.
Michael J. Ross is a Web developer, writer, and freelance editor.
You can purchase CSS Pocket Reference, 3rd Edition from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Despite the growth in the number of elements in CSS, and the attention paid to each one of them by the author of CSS Pocket Reference, the book is still small enough to fit in a pocket, at only 168 pages. The book's material is organized into 18 unnumbered sections, preceded by some notes on the book's typographical conventions, and followed by an essential index. The bulk of the material is found in the Property Reference section. Other sections explain how to add styles to HTML and XHTML pages; CSS rule structure and style precedence, including inheritance and the cascade; element classification and display roles; visual layout; rules on floating and positioning; and table layout. Subsequent sections cover CSS value types and units, and selectors, including some of the newest additions to CSS, such as the adjacent sibling selector and the language attribute selector. Just before getting into the details on properties, Eric Meyer discusses pseudo-classes and pseudo-elements, which have made it possible for Web developers to create rather robust and attractive site navigation using CSS exclusively, without any need to resort to images and JavaScript for rollover effects and other navigation eye candy.
For each element of CSS that is covered in all of the sections mentioned above, the types of information presented to the reader can vary, depending upon the category of element. But they generally include the element's possible values, a default value, what elements it can apply to, whether it is inherited, its computed value, a brief description of the element, at least one example illustrating its usage, what browsers support it, and oftentimes a note on its usage. Consequently, this new edition of the book, like its predecessors, should prove more than adequate for most CSS reference needs.
As with any computer book, there are several ways in which this one could be improved. Any reader using the book to look up a particular element, has two possible ways of doing so: They could first consult the index, and, assuming the element is listed there, go straight to the page indicated. But most readers, knowing that the elements in each section are listed alphabetically, will probably open up the book near the front or the back, and begin flipping backward or forward, respectively, hoping to spot the element of interest as quickly as possible, given its alphabetical ordering. That individual will likely immediately spot an obvious problem with the book: The pages have no running titles (the words that indicate the first element discussed on that page, and typically listed at the very top of each page). Inclusion of such running titles in the next edition of the book, would make it much faster to use.
Another valuable addition would be some sort of table listing all of the CSS elements and their level of support within the most commonly used Web browsers and, in the case of Internet Explorer, the most commonly used versions of the browser. Also, on page 48 of the book, at the beginning of the Property Reference section, it has a subhead of "Visual Media," which suggests that there are other subheads within that section, for other media types; but I was unable to find any.
All of these problems concern the publisher's choice of material. My last criticism concerns the layout of that material in the print version of the book. Because this diminutive volume has narrow pages, and they are tightly glued together in the binding, it is imperative that the publisher of such a book provide plenty of white space in the inner margins (those closest to the binding), so the reader does not have to crack open the book too much in order to read the text closest to the binding. Repeatedly opening up the book far enough to read those inmost words, will over time weaken and eventually destroy the binding. In contrast, a small reference book like this has no need for much outer margin. Sadly, O'Reilly got it backwards with this volume, with relatively wide and useless outer margins, and inadequate inner margins.
Aside from the aforementioned flaws — all of which can be remedied in the future — CSS Pocket Reference is a compact and neatly organized gem of a book, packed with information of value to busy Web programmers.
Michael J. Ross is a Web developer, writer, and freelance editor.
You can purchase CSS Pocket Reference, 3rd Edition from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Find it handy. It has some typos. And unfortunately the binding broke, but it was worth it.
I note that he mentions there is a list of "browsers that support" any given tag, and some notes. If it actually has some of the quick workarounds for the different browsers, I'm so buying this book.
I hate setting up something, then spending hours looking up workarounds for some random tag or other on IE.
An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.
But I couldn't find any info on nested tables.
IE does just fine with CSS. It may not be everybody elses CSS, but I've gotten CSS to work on both IE and Firefox anway...
IE speaks a completely different CSS language than Firefox, they just happend to sound about 95% alike.
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
Full Tilt
Eric Meyer also authored the Cascading Style Sheets 2.0 Programmer's Reference book. That book is my bible. I'm looking forward to an updated version, especially with browser support documented past IE 6.
In an effort to conform with internet communication standards, please note that the above comment is 100% biased opinion
I've had plenty of cases where both IE and FireFox have rendered my stylesheets properly, and plenty of cases where one has failed for some reason or another.
I'm not saying the 5% isn't going to produce a big difference, but that 5% also isn't an all-encompasing end of the world either.
Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
I have heard CSS called many things, but never a godsend.
Maybe not for tin-pot websites, but back in corporate land, you rarely get away with differences. Corporate image is extremely important to the money boys and girls. Fsck it up, and you'll be shown the door, or lose the business.
http://technical-writing.dionysius.com/resources/CSS-2.0.pdf
Helped me through many a "what's that called again?" session.
Link updated because both original links were dead.
technical writing / development
I was looking at the O'Reilly page for this book. Under the review section, there are two reviews: 3/5 and 5/5. The page claims the average is 5/5. Let's see, (3/5 + 5/5)/2 = ((3+5)/5)/2 = (8/5)/2 = 8/10 = 5/5. Oh, their math is right. Never mind.
Except that's not an entry in O'Reilly's "Pocket Reference" line. I was not speaking about O'Reilly's publications in general.
I can't wait to read this book and start encrypting DVDs....
this is especially useful for unconventional web developers who don't actually have access to the internet.
... to have a copy of a list of all ingredients in extistence in my back pocket in case I want to cook something.
Before I go further, I use CSS everyday I design, especially since I'm still learning all of it's annoying idiosyncrasies, mainly because (and I'm not the only one) the CSS language itself is flawed (constraints & variables being some of which CSS lacks). The idea of what CSS created for, style sheets, is great & is a step forward, but the way we have to use style sheets with CSS sometimes makes me wonder what an abortion feels like.
I admit, some days it seems to get *easier* to deal with since I actively remember the times I more or less lost my shit because the stupid code wouldn't render correctly in different browsers, so I also remember (most of the time) what to avoid, but I really don't think the full potential of style sheets will be fufilled with CSS as the way it is. Even with CSS 3 (I'm not touching HTML5; I'm one of those "wacky" people who think we should stick with what we have until it's stable enough to warrant additions; a more eloquent way of putting it has already been said: http://www.molly.com/2007/06/14/defy-the-pedantic-semantic-html5-and-xhtml-11-must-stop-for-now/ ), I just don't see the difficulties of CSS, which warrant most of the CSS books being made, being resolved anytime soon.
I know I'm not the only one who begrudgingly uses CSS (I realize they are other technologies to use instead or to supplement CSS' shortcomings, I'm currently looking into that...), and I know I'm not the only who thinks something new should be made to address what CSS fails to do. I'm not talking about HTML5, nor CSS3, and defintley not FLASH (although, personally, I think if HTML & CSS were to somehow utilize a plug-in for browsers to render shit properly, standards would be able to compete with FLASH, but I'm just rambling there).
While googling out of frustration, I came across this:
PSL (Proteus Style Sheets): http://www.cs.uwm.edu/~multimedia/papers/jucs/jucs.html
Why Current Style Sheet Standards Have Failed to Improve Document Engineering: http://www.cs.uwm.edu/~multimedia/WWW8/webEng.html
I know every single Pure-CSS zealot is going to moan & groan at me for thinking differently than them, but honestly, PSL seems like a way better idea than simply adding on to an inheritantly broken style sheet language in which books & books need to be made to tell people what hoops to jump through to get it work. I don't know, I guess that sounds stupid to too many people; often I've let that prevent me from expressing my not unreasonable doubts.
Sometimes I feel like some poor bloke who time traveled back to the Titanic but can't prevent anything due to paradox. :\
In corporate land you'll be using IE, so you create the pages that work best with that.
Don't bother with a book: W3Schools has got you covered.
weirdest thing I ever saw: scientology advertising on slashdot.
Now I can pimp my MySpace :|
I already have a CSS Pocket Reference. It's called an iPhone.
That one is my favorite too (though I used to use a cssv1 version that is very similar and the sources are obviously similar.
I also really like the diagram in this one but don't like how the rest of it is organized. Which is too bad because anyone that owns a domain name of ilovejackdaniels.com deserves more positive praise.
The next site to slashdot will be ready soon, but subscribers can beat the rush and start slashdotting it early!
would be cool to have this for javascript too
Dude, it's been like three hours. Are you OK in there?
In my experience, CSS doesn't do a great job of keeping Layout and Content separate. For example, look at the tutorials for putting rounded borders around a box, most of them involve adding 3-8 divs around your box.
I got this book right when it came out, to replace the well worn previous edition.
The back cover claims there is "a chart displaying detailed information about CSS support for every style element and its cross-browser compatibility."
I saw no chart in the book.
Maybe they tried to do the chart without tables and gave up..
-- Senior Software Engineer, Attorney appearance services, locallawyerapp.com.
<div class="content"
Just imagine how great it will be when you seperate your presentation from your content!
</div>
</div></div></div></div>
The 2nd edition of this book already covered CSS2 and CSS2.1. It says so right on the cover. How about a pocket reference that covers CSS3 -- and a widely-used browser that supports it well.
Producer: NEXT!!
Ralph Wiggum: Chicken necks
What sound do people on rollercoasters make? Hint: it's not Xbox 360.
Is this a joke or what!? Does this pocket reference explain this kind of gibberish?
/*Remove all spacings from the list items*/
/*Make the sub list items invisible*/
/*When hovered, make them appear*/ .nav ul li a{ /*Make the hyperlinks as a block element, sort of a hover effect*/
/*** Menu colors (customizable) ***/
.nav, li, a{
.nav ul li a:hover{
.nav ul li a:active{ .nav a{
Someone please translate this into something that resembles logic, please?
ul.nav,.nav, ul{
margin: 0;
padding: 0;
cursor: default;
list-style-type: none;
border: 0px solid #369;
display: table ;
}
ul.nav>li{
display: table-cell;
position: relative;
padding: 2px 6px;
}
ul.nav li>ul{
display: none;
position: absolute;
max-width: 40ex;
margin-left: -6px;
margin-top: 2px;
}
ul.nav li:hover>ul{
display : block;
}
display: block;
padding: 2px 10px;
}
ul.nav,
background-color: white;
color: blue;
}
ul.nav li:hover,
background-color: yellow;
color: blue;
}
ul.nav li:active,
background-color: black;
color: white;
}
text-decoration: none;
}
CSS is a miserable and irrational set of style tags that when used to do things like turn un-ordered lists in menu's becomes pretty much inscrutable and damn near unusable. Nested DIVS are a poor substitute for nested tables. If you want to say I am wrong, then show me how create that will hold data in perfect rows and columns, or how you can make two divs equally occupy 50% of the outer div's area.
Hey KID! Yeah you, get the fuck off my lawn!
Lower, dude. Those are your nuts that you're grabbing.
Have gnu, will travel.
A programming book has to be the kind you can sit down and read cover to cover (or chapter by chapter), that teaches something new. I simply don't have time to spend "getting to know" a particular book or painstakingly tracking down reference information.
These posts express my own personal views, not those of my employer
Say, there- I'm looking for ease of use...
Is this modern version of the legendary IBM 'green card' written as text or is it in trendy hypertext?
The latter would be preferable, especially if I'm on a PC and coding my HTML and CSS, etc... Of course, if it's hypertext, I'll hafta take it out of my shirt pocket to run the mouse across it, otherwise I might get unsightly mouse stains on my shirt.
But, all-in-all, sounds like a very useful product!
.
- aqk
F U
I use that diagram a lot. I have it pinned to my cubicle wall (here in Dilbert land) along with the Javascript cheat cheat, the regex cheat sheet etc..
For a complete selection of quick and dirty guides to common technologies IloveJackDaniels.com is a very handy resource, thanks Dave.
"Linux is for noobs"-The new MS fud strategy
and I can say that I have never used it. Not once. Its just easier and much much quicker to type "css reference" into my search box and click on the first result.