CSS Cookbook
By Christopher Schmitt
August 2004
Series: Cookbooks
ISBN: 0-596-00576-8
270 pages, $34.95 US, $50.95 CA, £24.95 UK
Short Review
A Very Good Book. :) :) :) :) of 5.
This book contains over 80 recipes
for solving common web design problems.
The recipes are in an easily understood
Problem/Solution/Discussion format
that O'Reilly favors in their Cookbook series.
The recipes are grouped into 10 chapters by topic.
This makes it easier to use the book as a reference.
In case you want to (or need to) explore further,
there's also a See Also part included in the format of each recipe.
This See Also part includes one or more references.
Many of the references are to the W3C CSS 2.1 spec.
If you have used CSS, at least a little,
and you use (or expect to use) CSS much
and you haven't already mastered CSS including CSS 2.1,
this book would likely be quite useful to you.
For more detail, see my Somewhat Longer Review.
George Woolley of Camelot.pm and Oakland.pm
[top]
Miscellaneous
Chapter Titles
- Web Typography
- Page Elements
- Links and Navigation
- Lists
- Forms
- Tables
- Page Layouts
- Print
- Hacks and Workarounds
- Designing with CSS
Notes:
- To view the full table of contents, visit the O'Reilly catalog entry.
- Check the full table of contents for a list of all the recipes.
All the sections of chapters that begin ...ing are recipes.
[top]
Some Related O'Reilly Books
|
"CSS: The Definitive Guide" (CSS details; learn CSS)
|
|
"CSS Pocket Reference" (CSS quick reference)
|
|
"JavaScript and DHTML Cookbook" (learn to use CSS with JavaScript)
|
|
"Learning Web Design" (learn web design; learn HTML)
See my review.
Note that the cover has changed since my review.
|
Note:
- You may wish to check out the catalog entry of one of these books
by clicking on the corresponding cover image.
[top]
Safari Watch
Notes:
- This book is on Safari Tech Books Online.
- For more info on Safari, click on the image above.
- My initial reading of this book was online using Safari.
- The first complete draft of this review was completed
before I had a paper version of this book.
[top]
Some Relevant Acronyms
- CSS: Cascading Style Sheets.
- style sheets from multiple sources
(the designer, the browser, the user)
that are applied in sequence
according to a set of rules that resolve conflicts.
- allows for a high degree of separation between content and presentation.
- makes it easy to change the style of many pages at once.
- refers ambiguously to CSS1, CSS2, etc.
- CSS1: CSS level 1.
- a W3C specification and recommendation for CSS (1996-05-12, revised 1999-01-11).
- specifies basic properties such as fonts, colors, margins, ...
- CSS2: CSS level 2.
- a W3C specification and recommendation for CSS (1998-05-12).
- includes CSS1.
- specifies many extensions including for
table layout, content positioning, downloadable fonts, generated text, ...
- supports media-specific style sheets for presentation on
printers, hand-held devices, braille devices, ...
- CSS 2.1: CSS level 2, revision 1.
- a W3C specification and recommendation candidate for CSS (2004-02-25).
- builds on CSS2. is a revision of CSS2.
- is based on experience with actual implementations of CSS2.
- removes CSS2 features that have not been implemented.
- Removes features that will be obsoleted by CSS3.
- adds a few features that were needed to implement CSS2.
- CSS3: CSS level 3.
- a W3C specification for CSS.
- includes CSS2.
- is under development.
- specifies many extensions including for
speech synthesis, user interaction, ...
- HTML: HyperText Markup Language.
- a markup language used for specifying hypertext documents on the Web.
- ISO: International Standards Organization.
- creates voluntary international standards.
- a federation of national standards organizations.
- SGML: Standardized General Markup Language.
- a powerful metalanguage that can be used to define markup languages.
- the metalanguage for HTML.
- an ISO standard (ISO8879).
- not itself a markup language.
- W3C: The World Wide Web Consortium.
- develops protocols for the Web to encourage its evolution.
- has over 300 organizations as members.
- XHTML: eXtensible HyperText Markup Language.
- a reformulation of HTML in XML.
- a W3C specification and recommendation.
- a markup language for web pages.
- XML: eXtensible Markup Language.
- a simplified dialect of SGML.
- a metalanguage that can be used to define languages.
- the metalanguage for XHTML.
- facilitates the exchange of data between computers.
Notes:
- Some of the above characterizations of acronyms
are obviously date dependent.
The above is as of 2004-09-15.
- One could argue that some of the above are not acronyms.
Give me a break, OK?
[top]
Request for Feedback
Let me know at george in the domain of metaart.org
if you feel that:
- I am wrong in general or in particular.
- Something is poorly stated.
- etc.
Thanks for considering giving feedback.
[top]
Somewhat Longer Review
Contents
Notes:
- Published by O'Reilly.
- Click on the cover image above to go to the catalog entry for the book being reviewed here.
- In fact, click on any of the cover images on this page to go to the catalog entry for the corresponding book.
The Cover
The Title:
Primarily from the O'Reilly website,
I understand that O'Reilly Cookbooks typically
- contain many recipes in a Problem/Solution/Discussion format.
- contain coding examples that illustrate the solution
- are organized to allow you to pick and choose what interests you at a particular time
CSS stands for Cascading Style Sheets.
These style sheets
- can be attached to a document
- are used to specify how a document is to be presented (i.e., it specifies fonts, colors, sizes, spacing, etc.)
Other Text:
We also see on the cover
- "Quick Solutions to Common CSS Problems"
- "Covers CSS 2.1"
CSS 2.1
- is a language for specifying presentation
- is a version of CSS
- builds on CSS1 and CSS2 (see Acronyms)
- supports media-specific style sheets for presentation
on printers, hand held devices, braille devices etc.
(as well as typical browsers on a personal computer)
Note:
A Fitting Cover:
The book delivers on the promise of the cover.
[top]
About the Reviewer
Design Background:
OK, I
- am webmaster of a number of non-profit sites
- have been using CSS for a number of years
- tend to keep HTML/CSS simple
- use JavaScript some but not intensively
- generally edit CSS and HTML using vim (i.e. a text editor)
However, I'm not a professional webdesigner.
Publisher:
I have many O'Reilly books,
and I am a big fan of O'Reilly.
OS and Browsers:
When I access the web,
I'm usually doing that from a Linux box.
The browsers I use the most for accessing the web are
Firefox,
Konqueror and
Opera.
[top]
What You Get
Recipes:
The heart of the book is 10 chapters of CSS recipes.
Each chapter contains recipes on the subject of the chapter.
For example, chapter 6 contains 5 recipes
that are concerned with tables.
The book contains over 80 recipes.
Each recipe has the following parts
- Problem - a simple statement of the problem
- Solution - (a step or) steps to follow and some code (CSS, HTML and/or Javascript)
to suggest a characteristic solution
- Discussion - an explanation of the solution including
additional information and perspective that might help in applying the recipe
- See Also - a reference or references to related recipes, the W3C CSS 2.1 spec, etc.
Figures are often used to show
- the default display (i.e. the display if the recipe is not applied)
- a display resulting from applying the recipe
Sample Designs:
There are also a few sections
with Titles beginning "Sample Design:" (or "Example Design:").
These sample designs
- address more ambitious problems than the recipes do
- are longer than the recipes
- do not follow the recipe format
Other Stuff:
There's what looks like a useful Resources appendix.
It has a number of links that are of interest to me.
But I've only followed a few of them so far.
The index looks adequate.
However, the organization of recipes is so clear to me
that normally I find myself using the table of contents to look for stuff
instead of the index.
[top]
What I Like
The Recipe Format:
I like the pragmatic recipe format.
Useful Recipes:
Many of the recipes were immediately useful.
In fact, in writing this review,
I used a number of the recipes including
- Recipe 1.2 Specifying Font Measurements and Sizes
- Recipe 1.8 Creating a Heading with Stylized Text and Borders
- Recipe 3.5 Creating Rollovers without JavaScript
- Recipe 4.7 Moving the Marker Inside the List
- Recipe 6.2 Setting the Borders and Cell Padding
- Recipe 6.3 Setting the Styles Within Table Cells
All these recipes worked in all three of my favorite browsers.
Understandable Organization:
The grouping of recipes into chapters is helpful.
Finite Length:
I like it that the book is relatively short,
that is, 80 some recipes and 272 pages by different measures.
[top]
Wishes
I was planning to call this part of my review "Gripes",
but I don't actually have any gripes about this book;
so I've called it "Wishes"
so I'll have something to say.
Availability of Links:
Many of the links in the Also See part of Recipes
and in the Resources Appendix
are of interest to me,
but it's a drag to type in so many links.
So I wish the book had a reference to a place on the web
where anyone could find all the links.
It turns out that I do have access to the links
through my online copy of this book
that's on my Safari online bookshelf. :)
But not everyone has Safari. :(
Browser Compliance:
I wish browsers all had W3C recommendations and candidate recommendations
implemented and working properly.
The book has a whole chapter of recipes
that are workarounds related to this problem.
And the book warns us of the problem
on some other recipes too.
One recipe I applied didn't work in one of my browsers
until I made a small change.
As far as I can tell, this was a browser problem,
but, hey, maybe it was me.
Anyway, the problem was not with the book,
since the approach I was trying deviated
significantly from the recipe.
[top]
Who's the Book for?
The book is for web designers and developers
interested in practical CSS solutions to common problems in web design.
Prerequisites:
The book says the reader should
- be at least a part time web designer or developer
- have a working knowledge of JavaScript
- know basic HTML
- be able to edit CSS and HTML code
Notes:
- As far as I can tell,
very little in this book really depends on the reader knowing JavaScript.
I wouldn't rule out getting this book
just because you don't feel comfortable with JavaScript.
- On the other hand,
I think some exposure to CSS would be a reasonable prerequisite.
What Not to Look for:
This book is
- not a CSS tutorial
- not a reference manual for CSS
- not a Cookbook of JavaScript solutions to common web design problems.
If you want one of these, I suggest
[top]
Final Thought
This book is a classic O'Reilly Cookbook.
If the the topic appeals to you
and you like the O'Reilly Cookbook format,
this could be a good book for you.
It was useful for me.
[top]