The CSS Anthology: 101 Essential Tips, Tricks and Hacks
Got something to say?
Share your comments on this topic with other web professionals
In: Reviews > Book Reviews
Published on January 5, 2005
I hate CSS
If you’ve been on any Web design mailing lists or forums in the last year or so, you will have heard (seen?) the anguished cry “I hate CSS!” Most often it’s from an experienced Web designer, frustrated by the lack of cross-browser support for CSS, lamenting the broken rendering of a site’s design.
Is this you? Have you had a brief affair with CSS and fallen out big time? Tempted by the promise of easy maintenance and accessible, search-engine-friendly Web sites? Then, having fallen foul of some malicious browser quirk, returned to the tables and font
tags you know best?
If you hate CSS, this book is for you. By removing one stumbling block at a time, it will guide you gently to a more pleasant relationship with CSS. You may find that instead of hating CSS, you will actually fall in love again.
Contents
The full table of contents is too long to reproduce here, but you can examine it at the publisher’s site.
Chapters
- Getting Started with CSS
- Text Styling and Other Basics
- CSS and Images
- Navigation
- Tabular Data
- Forms and User Interfaces
- Browser and Device Support
- CSS Positioning and Layout
- Experimentation, Browser Specific CSS, and Future Techniques
A brief summary of the contents:
- Answers to 22 questions about text styling & other basics
- 8 Answers to common questions about image formatting
- 9 Tips for using CSS for navigation elements
- 8 Hints for using CSS with Tabular Data
- 11 Ways to use CSS for Forms and User Interfaces
- 19 Solutions to Cross-Browser Compatibility issues
- 14 Essential Tricks to using CSS to replace tables for layout
- 12 Experimental or Browser-Specific CSS Hacks
(The numbers add up to 103, so I guess the book title is playing safe.)
Rachel, show me the way
The book is a surprisingly easy read with plenty of white space, illustrations and code samples. It follows a predictable format, with question, solution and discussion sections on each topic.
Its real strength is in the structure and flow of the book. You could even read it cover-to-cover if you had the time, but I suspect most designers will be dipping into the book for help with specific issues as they build their sites. Either way, it succeeds.
While the book is targeted at designers with some knowledge of CSS, the early chapters act as a refresher and gentle introduction, so don’t be put off if this is your first CSS book.
The chapters on tables and forms pay particular attention to accessibility issues and take a grown-up Web standards approach—clearly and concisely explaining how and why you should include the caption
and summary
attributes in your table element and how to effectively use label
, fieldset
and legend
elements in your forms.
What I liked
I like the easy flow and the feeling of being gently guided. There are plenty of extra tips and the advice is current and carefully controlled to retain a simplicity and ease of understanding.
I particularly liked the section in chapter seven entitled “I think I’ve found a CSS bug! What do I do?” which has some great suggestions for troubleshooting:
- Take a break.
- Validate your style sheet and document.
- Isolate the problem.
- Search the Web.
- Ask for help.
In the “Ask For Help” section there’s a simple list of guidelines for posting your question to a forum or a mailing list which are well worth a read:
“If you haven’t managed to find a solution as you’ve moved through the above steps, ask for help. Even the most experienced developers hit problems that they just can’t see past. Sometimes, just talking through the issue with a bunch of people who haven’t been staring at it all week can help you resolve the problem, or come up with new ideas to test—even if no one has an immediate solution.
When you post to a forum or mailing list, remember these rules of thumb:
- If the list or forum has archives, search them first, just in case you’re about to ask one of those questions that’s asked at least once a day.
- Make sure that your CSS and HTML validates; otherwise, the answer you’ll get is most likely to be, “Go and validate your document and see if that helps.”
- Upload an example to a location to which you can link. If you manage to reproduce the problem outside a complex layout, so much the better—this will make it easier for others to work out what’s going on.
- Explain what you’ve tried so far in the message. This saves the recipients of your message from pursuing those same dead-ends again, and shows that you’ve attempted to fix the problem yourself before asking for help.
- Give your message a descriptive subject line. People are more likely to read a post entitled, “Duplicate boxes appearing in IE5” than one that screams, “HELP!” Good titles also make the list archives more useful, as people can see at a glance the titles of posts in a thread.
- Be polite and to the point.
- Be patient while you wait for answers. If you don’t receive a reply after a day or so, and it’s a busy list, it is usually acceptable to post again with the word “REPOST” in the subject line. Posts can be overlooked in particularly large boards, and this is a polite way to remind users that you have not received any assistance with your problem.
- When you receive answers, try implementing the poster’s suggestions. Don’t get upset or angry if the recommendations don’t work, or you feel that the poster is asking you to try very basic things. I’ve seen threads go on for many posts with different posters weighing in to help someone solve a problem, and continuing the discussion until a solution is solved. Give people a chance to help!
- If you find a solution—or you don’t, and decide instead to change your design to avoid the problem—post back to the thread to explain what worked and what didn’t. This shows good manners towards those who helped you, but will also help anyone who searches the archive for information on the same problem. It’s very frustrating to search an archive and find several possible solutions to a problem, but to not know which (if any) was successful!”
I also liked the simple clarity of the code samples and the obvious care that has been taken to create solutions that are uncomplicated, avoid CSS hacks and maintain the separation of content and presentation.
What I’m not sure about
On my first scan of the book, I felt there were a few areas that needed more depth and sometimes I wasn’t quite sure if the solution offered was the best one. I say not sure because it was just a feeling, which diminished as I read more of the book.
So to be fair, I think that in order to best serve the confused and frustrated designer, this book stops in just the right places and includes plenty of recommendations for where to seek further assistance and find more in-depth advice to some of the questions posed.
Summing up
The first four chapters are available as a PDF file in exchange for your email address. So, are the other five chapters worth buying the book for? Most definitely yes, especially if you hate CSS.
If you’ve been struggling with building Web sites using Web standards and CSS, you really must buy this book. It’s packed full with useful, real-life advice, hints and tips, clearly laid out and carefully explained.
If you’re already in love with CSS I doubt you’ll learn much new, but it will be a handy reference and quick start guide for those “I forgot how to…” moments.
Go get a copy. Now!
About the Author
Rachel Andrew is the Director of edgeofmyseat.com, a Web solutions company in the UK. She is a member of the Web Standards Project, serving on the Dreamweaver Task force.
Rachel’s writing credits include: Dreamweaver Developer’s Instant Troubleshooter (Apress), Dreamweaver MX Design Projects (Apress), Dynamic Dreamweaver MX (glasshaus), Fundamental Web Design And Development Skills (glasshaus)
The CSS Anthology: 101 Essential Tips, Tricks & Hacks
ISBN 0957921888
Rachel Andrew
SitePoint, 2004, 376pp.
US $39.95
Companion Website: http://www.sitepoint.com/books/cssant1/
Related Topics: CSS, Web Design, Web Standards
Tony Crockford is a UK-based Web Developer, founder member of MACCAWS and can be found helping out the CSS newbies on the UK freelancers list.