Appendix A. CSS Property Reference

Mastering Cascading Style Sheets involves knowing how to use a large number of CSS properties that control the appearance of text, images, tables, and forms. To help you in your quest, this appendix gives you a summary of common properties and values you’ll use to create your own styles. This list covers nearly all of the CSS 2.1 standard properties—the ones that most web browsers support—as well as a handful of the most useful and commonly supported CSS3 properties.

Note

The latest CSS specification is really quite large. In fact, to better manage the growth of CSS, the W3C split CSS into many modules—each module describes a particular property or set of related properties. For full details straight from the horse’s mouth, visit the latest CSS specifications from the World Wide Web Consortium at www.w3.org/Style/CSS/current-work.

CSS Values

Every CSS property has a corresponding value. The color property, which formats font color, requires a color value to specify which color you want to use. The property color: #FFFFFF; creates white text. Different properties require different types of values, but they come in four basic categories: colors, lengths and sizes, keywords, and URLs.

Colors

You can assign colors to many different properties, including those for font, background, and borders. CSS provides several different ways to specify color.

Keywords

A web color keyword is simply the name of the color, like white or black. There are currently 17 recognized ...

Get CSS3: The Missing Manual, 3rd Edition 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.