Get Started with CSS


*Before you begin this tutorial it is necessary to be familiar with HTML*

In this tutorial, you will learn how to make an external CSS file, save it, and then link to it in your webpage.

Creating an external CSS file

To create a CSS file you will need to use a program like Notepad. Open Notepad and type in the following:
body{ background-color:blue; }
The above code makes the page's background color blue. It consists of two parts: the selector and the declaration. The selector is whatever HTML element you are editing(the body, also <body>). The declaration is how it change the HTML element, it consists of the property(background-color in this case) and the value(blue).

Saving your file

To save your html page, click file, save as. Title your file and add an extension of .css. Next change the file type to "All Files".

Linking to your external CSS file

One of the advantages to using an external CSS file is that you won't have to add the same formatting to each of your webpages. All you have to do to use one CSS file for all your pages is to add the following code in the <head> of each webpage.
<link rel="stylesheet" type="text/css" href="programit.css">



Real Time Web Analytics