HTML and CSS Reference
In-Depth Information
Relative Units
Relative units that can accompany length values include the following:
em (size of em square in current font)
ex (size of x-height in current font)
px (pixel)
Percentages
Several CSS properties allow for percentages as values. A percentage in CSS is indicated as
a decimal number in the range 0-100 followed by a percent symbol ( % ).
Position Keywords
Five position keywords as available as values for several properties: left , right , center , top ,
and bottom .
URLs
Some properties can take a URL to a file (often an image) as a value. In these cases, the
possible syntaxes are as follows:
url(protocol://server/pathname)
url(pathname)
Properties That Accept Multiple Instances
The following properties can be used to set the associated individual top, right, bottom, and
left properties: margin , padding , border-width , border-style , and border-color .
When multiple instances of a property are used, the following ordering applies: top, right,
bottom, left (clockwise around the element).
Examples include
margin: 1em; /* all margins set to 1em */
margin: 1em 2em; /* top and bottom margin set to 1em, left and right margin
set to 2em */
margin: 1em 2em 3em; /* top margin set to 1em, left and right margin set to
2em, bottom margin set to 3em */
margin: 1em 2em 3em 4em; /* top, right, bottom, left, respectively */
Inherit
The keyword inherit is a valid value for all CSS properties. Anytime inherit is stated, the
associated property will be set to the same value as the parent of the selected element or
elements. Most properties inherit naturally, so many times you will not need to specify it
explicitly, but it is available if you need it.
Search WWH ::




Custom Search