Home
XHTML
CSS
PHP
MySQL
SEO
JavaScript
Computer Basics
Number Systems
LINUX


CSS Value Types

CSS | Styles | Colors | Type | Classes-IDs | Layout | Properties | Value Types

Properties are measured with different Value Types. The most common value type is measured in pixels.

Pixels are a fixed length based on screen resolution. Positive or negative values can be used...

p {font-size:20px; width:300px; margin-top:-20px;}





Percentages are a relative length based on the parent element...

p {font-size:50%; margin:75%;}





Elements are a relative length based on the size of the font. 1 em is equal to 100%. 1.5 em is equal to 150%...

p {font-size:1.5em;}





Some properties allow URLs as value types, such as the background-image property. The URL path is relative to the style sheet...

p {background-image:url(image.jpg);}





Many properties allow predefined value types. The font-style property allows the values of normal, italic, or oblique. The font-weight property allows the values of lighter, normal, bold, or bolder. Other predefined values are available depending on the property. One value type common to most properties is inherit, which matches the value type of the parent element.




Other value types are measured in absolute units, such as inches (in), centimeters (cm), millimeters (mm), points (pt), and picas (pc). These value types are more common for print applications.




SEO Vancouver, Washington
SEO Portland, Oregon
Website Design Vancouver, Washington