Jump to ratings and reviews
Rate this book

CSS Cookbook

Rate this book
As the industry standard method for enriching the presentation of HTML-based web pages, Cascading Style Sheets (CSS) allow you to give web pages more structure and a more sophisticated look. But first, you have to get past CSS theory and resolve real-world problems. For those all-too-common dilemmas that crop up with each project, CSS Cookbook provides hundreds of practical examples with CSS code recipes that you can use immediately to format your web pages. Arranged in a quick-lookup format for easy reference, the second edition has been updated to explain the unique behavior of the latest Microsoft's IE 7 and Mozilla's Firefox 1.5. Also, the book has been expanded to cover the interaction of CSS and images and now includes more recipes for beginning CSS users. The explanation that accompanies each recipe enables you to customize the formatting for your specific needs. With topics that range from basic web typography and page layout to techniques for formatting lists, forms, and tables, this book is a must-have companion, regardless of your experience with Cascading Style Sheets.

516 pages, Paperback

First published August 1, 2004

14 people are currently reading
187 people want to read

About the author

Christopher Schmitt

26 books3 followers
An award winning designer, web developer, writer, and speaker.
He earned an Undergraduate Degree from Florida State University in Fine Arts with emphasis in Graphic Design. He also earned a Master’s Degree from Florida State University in Communication for Interactive and New Communication Technologies and a Graduate Certificate in Project Management from FSU’s College of Communication. Christopher authored many books on web design, most notably the “CSS Cookbook” for O’Reilly Publishing. He produced and led the NonBreaking Space Show podcast, which discussed web design and related issues. Through his company, Heatvision, he hosted web-related professional conferences around the world, improved the accessibility and structure of his clients’ websites, and advocated for a more inclusive Web.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
66 (29%)
4 stars
81 (36%)
3 stars
62 (27%)
2 stars
12 (5%)
1 star
1 (<1%)
Displaying 1 - 15 of 15 reviews
Profile Image for Matt.
752 reviews614 followers
to-be-considered
October 8, 2017
I was sort of fed up with this new design they use on Goodreads. Especially for the font they use on the review pages. A Sans-Serif font for a running text?! Give me break.

The easiest solution I found (so far) is to use a plugin for my browser with which I am able to adjust the styles of any webpage to make it look like I want. This plugin is called simply Stylish.

What I basically wanted was to

- use a Serif-Font (Georgia in this case) almost anywhere on Goodreads
- make the text of a review a little larger
- make the text of a review justified
- some other things :)

Please note: This is a just my personal idea of a new style and it's far from perfect. It only works on the browser where you installed it. I don't take any responsibility.

UPDATE Aug 9, 2016

The new design of the timeline is hard to tackle to make it look good to me. I added four more styles to make it at least a little bit more pleasing to my eyes: The book covers, blurbs and comments become smaller and the review text uses a serif font, is justified and has a yellowish background color. You can update the style within the stylish plugin.

UPDATE Oct 8, 2017

As of today, it seems, we are blessed with a so called iframe that displays google-ads in the top right corner of the timeline. Although my ad-blocker takes care of the content (read: removes it), there was still a nasty looking empty space there, so I had to update my stylesheet accordingly, spending a minute of my valuable free Sunday time. The bill's in the mail.

If you already installed the stylesheet you have to repeat step 2 below and update it.

- - - - - INSTALLATION - - - - -

Step 1
Install the Stylish plugin. You can download it from here (it's available for Firefox, Chrome, Safari, and Opera)

https://userstyles.org/stylish

Step 2

Click here to install the stylesheet. It's called Goodreads Reloaded:

https://userstyles.org/styles/121918/...

Install the style by clicking on the green button labeled "Intall with Stylish" on the upper right. You need Javascript to be enabled for that.
After installing you can edit the styles to your need.

If you don't exactly know what this is all about you should read the book at hand.

Here's the current code I use for my stylesheet:

Profile Image for Will Semin.
17 reviews15 followers
November 1, 2019
Having finished this book, I'm simply itching to do some refactoring.
Profile Image for Monica Willyard Moen.
1,361 reviews28 followers
August 14, 2022
I value this type of book because it gives lots of code samples that can be used in projects, while also providing explanations of how and why they work as they do. This book helped me when I was first learning how to use style sheets with websites.
Profile Image for Jillian.
191 reviews23 followers
September 9, 2024
Reading Blog || Socials

This is a great book for learning industry standards when it comes to styling web pages. Internal versus external stylesheets, the explanation of why they are even called cascading style sheets, and so much more. My only concern with these textbooks is that they get outdated so quickly due to the advancements happening as quickly as they are. This is a great reference guide!
Profile Image for Sammy.
6 reviews
July 26, 2019
I liked it! I could relate to much of the writing angst and decisions about stepping away from the novel writing. Not sure I’d recommend it for non-writers though.
Profile Image for Sebah Al-Ali.
477 reviews3 followers
August 21, 2010
رغم أن نسخة الكتاب قديمة (2007) إلا أني تعلمت الكثير من المعلومات و استطعت تأكيد الكثير مما تعلمته بالتجربة مع السي إس إس.

أعجبني منهج الكتاب المتبع: قسم الكتاب على فصول، في كل فصل يتناول جانب من جوانب السي إس إس، و بدلا من تقدم المعلومات بأسلوب شرح ممل و نظري، لجأ إلى طرح "مسائل" و "مشاكل" قد يواجهها المصمم و التي تتعلق بالفصل، ثم يقدم الجواب للمسألة مع شرح الأساسات المتعلقة بها. فـ تعلمت الأساس النظري في محيط عملي. كان ممتعا جدا.


هناك الكثير الذي أود تدوينه، لكن وقتي لا يسعفني. و أريد الانتقال لكتب أخرى. لذا لن أستطيع تدوين كل ما أود الاحتفاظ به من الكتاب. لكن، مبدئيا:

* أعجبتني كثيرا مسألة تحديد تنسيق الأشياء بشكل أكثر تفصيلا. بمعنى
li {}
تحدد معالم كل نقطة بشكل عام. لكن حين نستخدم التالي:
li+li{}
يقوم بتحديد معالم النقاط التي تسبقها نقطة أخرى. يعني ينطبق على النقطة 2 و 3 و .... و لا ينطبق على النقطة 1. و المثل للفقرات و الأشياء الأخرى. هذا مفيد جدا. <- استخدمته فور تعلمي له


* و أيضا أعجبتني كثيرا خاصة تحديد التنسيق بناء على المتحوى في الروابط. مثل:
a[href="wa7di.com":]{}
تنسق الروابط التي تشير لمدونتي بشكل حصري!. خاصية مبهرة يمكن استخدامها بطرق متعددة.
و حين يكتب على شكل:
a[title~="happy":]{}
أي رابط يحوي عنوانه هذه الكلمة، يتم تنسيقه بهذا. أما حين نكتبه مثلا:
a[href|="digital":]{}
ينسق الروابط التي تحوي تلك الكلمة مع -. إذن الفكرة العامة:
a [attribute=val:]{}
(^بدون النقطتين. :/! الجودريدز بشكل تلقائي يضيف نقطتين لهذا النوع من الأقواس.)

*و لكي أتذكر، الأشياء التي تلحق الرابط:
a:link, a:visited, a:hover, a:active

*أيضا تعلمت أنه يمكن أيضا التحكم بشكل أكبر بتنسيق الفقرات. من خلال استخدام:
p:first-letter{} ينسق أول حرف!
p:first-line{} ينسق أول سطر!


* positions: كنت أجد صعوبة في فهم منطقها، لكن الآن فهمت.
- absolute: position based on window rather than element's default position.
- relative: position modified based to its natural position as rendered by the browser.


* لم أجرب بعد، لكن يقول الكاتب أنه يمكن استخدام أكثر من خلفية في أمر الخلفية. مثال:
background: url(x.jpg) center no-repeat,
url(y.gif) top center no-repeat,
url(x.gif) 40% 24px no-repeat;


*coloring the scrollbar:
body, html{
scrollbar-shadow-color:;
scrollbar-face-color:;
scrollbar-highlight-color:;
scrollbar-3dlight-color:;
scrollbar-track-color:;
scrollbar-darkshadow-color:;
scrollbar-arrow-color:;
}

*ممكن إضافة محتوى للأشياء من خلال السي إس إس!. مثلا:
li:before{content: ">> ";}
li:after{content:".";}


*
media="print, screen"
types: all, handheld (mobiles), print, projection, screen.
or: in css, @media print{}, @media scree{}

22 reviews21 followers
July 14, 2010
This book succeeds in some places and gets fairly bogged down in others. I cannot hold that against it too much though, I read it straight through, but it probably is much better as a reference. Despite some flaws, this book has some real strengths. Unlike a lot of technical book, this book is rooted deeply in the practical. It mentions JavaScript solutions where they are useful. It has lots of links to blog posts and websites with additional information. Some books are written by people paid to write books, other books are written by practitioners who have learned from experience and have something to say. This book definitely strikes me as the latter. I think used as an actual cookbook, this book definitely deserves a spot on your bookshelf.
9 reviews1 follower
October 5, 2009
Lots of CSS examples to wrap your mind around. I think there must be some errors, or some of the examples just do not make sense.

I wish some of these examples were more fleshed out. The CSS is given with no HTML usage or example of the effect. Since I'm still learning CSS, this make it challenging.
Profile Image for Will Smith.
26 reviews1 follower
January 3, 2008
Its more of a reference, but I'm always reading it to get new ideas. The only problem i have with this book is- because I'm learning on my own and this is second edition - it assumes i know a lot more than i actually do, so i have a hard time understanding some of its concepts
Profile Image for Mike.
690 reviews
September 27, 2018
I can't say I've read this book cover-to-cover, but of all my CSS books, I find this is the one I refer to the most. Actually, I have a number of O'Reilly "Cookbook" technical books, and they are uniformly the most useful books of my collection.
Profile Image for joke.
30 reviews1 follower
June 9, 2016
As the industry standard method for enriching the presentation of HTML-based web pages, Cascading Style Sheets (CSS) allow you to give web pages more structure and a more sophisticated look. But first, you have to get past CSS theory and resolve real-world problems.
Profile Image for Vladimir.
123 reviews
September 8, 2016
Oh my god. It's one of the most boring book which I read.
All advices were actually in the start of century. Now this book should be considered as the museum exhibit.
Displaying 1 - 15 of 15 reviews

Can't find what you're looking for?

Get help and learn more about the design.