A Property’s Value

Each CSS property has different rules about what values it can accept. Some properties only accept one of a list of predefined values. Others accept numbers, integers, relative values, percentages, URLs, or colors. Some can accept more than one type of value. While the acceptable values for each property are listed in the section describing that property (mostly in Chapters 10 and 11), I’ll discuss the basic systems here.

Inherit

You can use the inherit value for any property when you want to explicitly specify that the value for that property be the same as that of the element’s parent.

Predefined Values

Most CSS properties have a few predefined values that can be used. For example, the display property can be set to

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.