A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.
It's fast and free.
processing...Retrieve Sign In
Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.
processing...Welcome to Webmonkey
- edit articles
- add to the code library
- design and write a tutorial
- comment on any Webmonkey article
Sign In Information Sent
CSS Units of Measure
/skill level/
/viewed/
Throughout this CSS reference guide, abstract values (notably values involving units of measure) appear between angle brackets:<color>. They should be replaced by actual values as indicated in the key below.
Contents |
Length Units
<length> indicates a number followed by a unit of measure:24px.
The number can be an integer or a decimal fraction, and can be preceded by + or -.
Units can be absolute or relative:
Absolute: mm, cm, in, pt, pc (millimeters, centimeters, inches, points, picas)
Relative: em, ex, px (the element's font height, the element's x-height, pixels)
Font size may be defined in points, pixels, inches, or centimeters (pt, px, in, cm) or as a percentage.
<absolute-size> can be:xx-small, x-small, small, medium, large, x-large, xx-large.
<relative-size> can be:larger, smaller.
Percentage Units
<percentage> indicates a number followed by a % sign:50%.
In the text-indent, margin, padding, and width properties, percentage values are relative to the width of the parent element.
In the font-size property, percentage values are relative to the font size of the parent element.
In <color> values, percentages can be used to express RGB values.
Color Units
<color> can represent either <color-name> or <rgb> values, as defined below:
<color-name> can be: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow
<rgb> can be:
#<hex><hex><hex>
rgb(<number>, <number>, <number>)
rgb(<percentage>,<percentage>,<percentage>)
<hex> represents a hexidecimal value, <number> a decimal value, and <percentage> a percentage.
Article
Suggested readings
|
Stylesheets Guide |
/related_articles/
Special Offer For Webmonkey Users
WIRED magazine:
The first word on how technology is changing our world.
