Skip to Content
Smashing CSS: Professional Techniques for Modern Layout
book

Smashing CSS: Professional Techniques for Modern Layout

by Eric A. Meyer
November 2010
Intermediate to advanced
300 pages
6h 1m
English
Wiley
Content preview from Smashing CSS: Professional Techniques for Modern Layout

Chapter 3. TIPS

EVERYONE CAN USE a few good tips to get through life. Two of my favorites are "always favor a small house on a nice street over a big house on a lousy street" and "don't eat lead." And so it is in CSS: A few simple words to the wise can put you right in no time flat.

In this chapter, we discuss the importance of ordering of values, proper uses of unitless values, ways to make elements disappear, a method for controlling border appearance, list tricks, print-style development, and much more.

VALIDATE!

This might be old hat to you. You might be wondering why I would waste precious ink and tree pulp on so obvious a topic. And yet, how often do you actually validate? Once at the end of the project, or all the way through?

While I'm not telling you to validate every time you hit "Save" on the document you're writing, it is a good idea to get into the habit of validating at regular intervals as you go through a page build. That way, you catch problems before they infect the whole page structure.

There are a few good validators out there for both HTML and CSS. In the HTML sphere, probably the most widely used validator is the one provided by the W3C itself and located at validator.w3.org (see Figure 3-1). Its CSS-centric cousin, sited at jigsaw.w3.org/css-validator/, is equally popular.

The W3C's HTML validator.

Figure 3.1. The W3C's HTML validator.

What if you're stuck developing behind a firewall, or do ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Using SVG with CSS3 and HTML5

Using SVG with CSS3 and HTML5

Amelia Bellamy-Royds, Kurt Cagle, Dudley Storey

Publisher Resources

ISBN: 9780470684160Purchase book