CSS Cookbook

... Show More
Cascading Style Sheets (CSS) are a powerful way to enrich the presentation of HTML-based web pages, allowing web authors to give their pages a more sophisticated look and more structure. CSS's compact file size helps web pages load quickly, and by allowing changes made in one place to be applied across the entire document, CSS can save hours of tedious changing and updating.But to leverage the full power of CSS, web authors first have to sift through CSS theory to find practical solutions that resolve real-world problems. Web authors can waste hours and earn ulcers trying to find answers to those all-too-common dilemmas that crop up with each project. The CSS Cookbook cuts straight through the theory to provide hundreds of useful examples and CSS code recipes that web authors can use immediately to format their web pages.The time saved by a single one of these recipes will make its cover price money well-spent. But the CSS Cookbook provides more than quick code solutions to pressing problems. The explanation that accompanies each recipe enables readers to customize the formatting for their specific purposes, and shows why the solution works, so you can adapt these techniques to other situations. Recipes range from the basics that every web author needs to code concoctions that will take your web pages to new levels.Reflecting CSS2, the latest specification, and including topics that range from basic web typography and page layout to techniques for formatting lists, forms, and tables, it is easy to see why the CSS Cookbook is regarded as an excellent companion to Cascading Style The Definitive Guide and a must-have resource for any web author who has even considered using CSS.

272 pages, Paperback

First published August 1,2004

About the author

... Show More
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.


Community Reviews

Rating(3.9 / 5.0, 14 votes)
5 stars
4(29%)
4 stars
4(29%)
3 stars
6(43%)
2 stars
0(0%)
1 stars
0(0%)
14 reviews All reviews
March 26,2025
... Show More
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
March 26,2025
... Show More
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.
March 26,2025
... Show More
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!
March 26,2025
... Show More
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.
March 26,2025
... Show More
رغم أن نسخة الكتاب قديمة (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{}

March 26,2025
... Show More
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.
Leave a Review
You must be logged in to rate and post a review. Register an account to get started.