Style Sheets Style Sheets are a good way of maintaining a consistent look throughout a Web site. They work by separating the look of a site from its contents. This means that you can define how a page looks externally to the page itself. Not all Web browsers support Style Sheets, so don't lean on them too heavily if you want your pages to work in older browsers. Style Sheet rules are used to create the look of your page:
A Style Sheet Rule
Here is an example of a Style Sheet rule, to demonstrate the different
elements of rules
In the example above the H1 part of the line is called
the SELECTOR
Each DECLARATION is made up of 2 parts - the PROPERTY (in this case color), and the VALUE (in this case blue.). Creating Style Sheet Rules Here are some points to remember when creating Style Sheet Rules
Adding Style Sheets to your Site You can define the look of your site using Style Sheets in two ways:
If you use the second technique, you only have to change one file and the style of your pages changes across the site. Creating an External File
<link REL=stylesheet href="[name_of_file].css" type="text/css"> in the header part of your html document. This should then apply the style rules you have created in the page. |