Like (X)HTML, an external style sheet is saved a plain text file saved with the file extention: .css.

You can create and edit CSS with any text editor that saves plain text.

Unlike HTML, normal humans won’t be looking at the information in your style sheet. CSS code is only commands that the computer will interpret.

CSS code looks like this:

p {
   color: red;
}

(This would make all the text inside of paragraph tags red.)

A couple key things to note:

  • Each CSS rule must open and close with curly braces.
  • The property and the value are separated with a colon.
  • Properties within a rule must end with a semicolon.

The best way to start styling your document with CSS is to apply styles to the basic HTML tages themselves.

Here is a very basic style sheet:

/* basic html */
body {
  color: #333333;
  font-family: georgia,times,serif;
  background: #cccccc;
  margin: 10px;
}
p {
  margin-top: 6px;
  margin-left: 10px;
  color: #000000;
}
h1 {
  color: #990066;
  font-weight: bold;
  font-size: 40px;
  font-family: helvetica,arial,sans-serif;
  margin-left: 20px
}
/* links */
a:link {
 font-weight: bold;
 text-decoration: none;
 color: #990000;
}
a:visited {
  font-weight: bold;
  text-decoration: none;
  color: #993333;
}
a:hover,
a:active {
  text-decoration: underline;
  color: #ff0000;
}