This webpage is updated by Len Hom on April 19, 1999
Len's Style Sheet 1 - Getting Started
Getting Started
Let's begin with setting the color of the text and the background.
You can do this by using the STYLE element to set style properties for the
document's tags using style elements:
< STYLE TYPE= "text/css" >
BODY { color: black; background:white; }
< /STYLE >
- The items between < STYLE > and < /STYLE > is written in special
notation for style rules. The TYPE attribute indicates that this is a CSS style sheet.
- Each rule starts with a tag name followed by a
list of style properties enclosed in brackets as noted { and }.
- In this example, the rule matches the BODY tag.
- Each style property starts with the property name, then a colon, and lastly
the value of the property.
- When there is more than one style property in the list,
you need a semicolon between each of them.
- In this example, there are two properties ( color and background ).
The " color" sets the color of the text and " background " sets the color of the page
background.
- It's a good idea to add a semicolon after the value of each property to ensure
that they are properly addressed.
Colors can be given as names or as numerical values, i.e.
rgb ( 204,204,255 )
which is a purple color.
- The three numbers correspond to red, green, and blue,
respectively, in the range of 0 to 255.
- You can use hexadecimal notation also, so that the same color can
be written as #CCCCFF.
Note that the STYLE element must be placed in the document's HEAD section
along with the TITLE element. It should not be placed within the BODY
section.
If you have any comments or questions, please send email to:
Len Hom
Back
Next
Return to Beginning of Page
I take full responsibility
for the information posted. The information on this page
represents that of myself and not that of
California State University,
Sacramento or the School of
Engineering and Computer Science