You save your style definitions in a simple text file with the extension .css, for example mySite.css. Then, you link the file to your Web pages (as discussed later). Because CSS files are text, you can edit them in any text editor (like Notepad, TextEdit, or vi).
So, to begin, fire up a text editor. The empty file will be the shell for your CSS file. You can combine print and screen styles in one file, or create a separate CSS file for each type of media.
Going for the Body
First, let's set up the style for the <body> tag. Type the following in your text editor.
body {margin-left: 30px; font-family: sans-serif; font-size: medium; padding: 6px;}
The margin-left: 30px property indents the all elements of the Web page 30 pixels from the left margin. This adds some nice white space to print documents, and when combined with the styling that we're going to add to the headings later on will create a neat effect.
If you're wondering why I used pixels as a unit of measure, it's because most Web browsers understand what pixels are, and they all display elements set in pixels in pretty much the same way. Use any other unit of measure, like points or inches, and the results vary from browser to browser.
The font-family: sans-serif property sets all body text to a sans-serif font. Many old-school typesetters insist that in printed documents, headings be in a sans-serif font (like Helvetica) and body text be in a serif font (like Times). I don't believe that this is a hard and fast rule. Experiment with different fonts. But your font choices should be made on the basis of readability, not how cool you might think the font is. And remember that the font you specify for the will affect all elements contained in the body of your Web pages: paragraphs, list items, table cells, etc. The font-size: medium property sets the font size to about 12 points, the size of the type in a newspaper or magazine. That's quite legible, but if you think the font is too large you can change the size to small.
I included the padding: 6px property to add a bit of space (padding) around the margins. You can add this style to your screen stylesheet, too.