Prev | Current Page 198 | Next

Tommy Olsson and Paul O'Brien

"The Ultimate CSS Reference"

For example, the following background declaration is wrong:
p {
background: #fff inherit left top;
}
In this case, you might be hoping that this element will inherit the parent??™s
background-image property. Unfortunately, you??™d be out of luck. inherit must be
the only value in the declaration, because there??™s simply no way of identifying the
subproperty to which the value inherit refers??”after all, it??™s not unique within the
sequence. In the example above, inherit becomes ambiguous: it could refer to the
background-image property, or to the background-attachment property, and the
user agent has no way of knowing which one it applies to. To have an element
inherit a specific property, you need to use the full notation instead of shorthand.
In this case, we need to specify the background-image property:
137 The Cascade, Specificity, and Inheritance
p {
background-image: inherit;
}
To find if a property is inherited by default, refer to the specific property reference
page.


Pages:
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210