Why Validate?

As much as you try to pay attention to details, it is easy for small errors to sneak into your style sheet. Validating your style sheet and HTML file can serve as a form of proofreading, catching small errors and typos in your code that are otherwise difficult to see or notice. A common example of a CSS error, for instance, is forgetting to specify a measuring unit. This is easy to do, because in HTML, numerical measures specify pixels by default, while in CSS you have to specifically identify which measuring system you're referencing (pixels, ems, percentages, centimeters, and so on). Other very common errors include using a regular parenthesis when you need to use a squiggly parenthesis or using a colon when you need to use a ...

Get Cascading Style Sheets (CSS) by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.