Checking the Easy Stuff: CSS

While CSS syntax is pretty straightforward, it has some common pitfalls, especially if you’ve gotten used to writing HTML or XHTML.

To check the easy stuff with CSS:

  • Make sure you separate your properties from their values with a colon (:) not an equals sign, like you do in (X)HTML (Figures 22.8 and 22.9).

    Figure 22.8. Bad! It’s hard to break the habit of separating properties and values with the equals sign. But you must.

    Figure 22.9. Much better. Always use a colon between the property and the value. Note that it doesn’t matter if you add extra spaces before and after the colon.

  • Be sure to complete each property-value ...

Get HTML, XHTML, & CSS, Sixth Edition: Visual QuickStart Guide 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.