CMPS 335 Advanced Web Publishing
Cascading Style Sheets
Length Values
- Relative Values: px, em, % (1em is equivalent to 100%)
- Absolute Values: pt, mm, cm, in (1in = 2.54cm)
CSS Properties and Their Values
Properties Values
-----------------------------------------------------------
font-family Times, New York, Garamond (serif)
Arial, Helvetica, Geneva
font-size 12pt, ...
font-style italic, normal
font-weight bold, bolder, lighter, normal
font-variant small-caps, normal
line-height 1, 2, etc.
(single-spacing, double-spacing, etc)
text-align left, right, center, justify
text-indent 2em, 3em, ...
text-transform capitalize, uppercase, lowercase, none
text-decoration underline, line-through, none
background-color #FFFFFF, blue, ...
background-image url(background1.jpg), ...
margin-left 4em, ...
margin (a length value, a percentage, or auto)
border 20px, ...
position absolute, relative
top 10em, 15em, 20px, 30px, ...
left
width
background (setting multiple background values)
font (setting multiple font values)
Examples:
A {font-family: Arial,sans-serif;
font-size: 16pt; color: red; text-decoration: none;}
H2 {font-family: times,serif font-size: 28pt;:
text-weight: bold;}
It is possible to set several font properties and their values in one
declaration without specifying the property names as shown in the following
examples:
H2 {font: 28pt times,serif bold;}
H3 {font: 14pt italic
helvetica,arial,sans-serif bold;}
Examples
Return to CMPS 491 Main Page
Return to Web Site Home Page