416 Chapter 23 – Cascading Style Sheets
Properties
Web Design in a Nutshell, eMatter Edition
Length values from the left and top margin can also be specified. Or you can
use the keywords, which correspond to the percentage values 0%, 50%, and
100%, respectively. The two examples given create the same result, with the
bottom-left corner of the image placed in the bottom-left corner of the
element.
background
Values:
background-color|background-image|background-repeat|back-
ground-attachment|background-position
Example:
BODY { background: silver url(nightsky.gif) no-repeat fixed }
BODY { background: url(oldmap.gif) bottom left }
Applies to:
Block-level elements
Inherited:
Yes
This is a shorthand property for specifying all the individual background
properties in a single declaration.
Classification Properties
These properties classify elements into categories rather than setting specific visual
parameters.
display
Values:
block|inline|list-item|none
Example:
P { display: block }
IMG { display: none } (turns off all images)
Applies to:
All elements
Inherited:
No
This property defines how and if an element is displayed. A value ofnone
turns off the display and closes up the space the element would otherwise
occupy.blockopens a new box that is positioned relative to adjacent boxes.
list-itemis similar to blockexcept that a list-item marker is added.
inline results in a new inline box on the same line as the previous content.