CSS: External Stylesheets

Have you ever found yourself with a website that suddenly needs a complete overhaul, and you have to edit hundreds of pages CSS? Well, such things are more easy if you switch to an external stylesheet. With an external stylesheet, you will only have to edit one file for it to affect all of your pages.

It's very easy to set up, although some tutorials can make it look confusing. Simply bring up your preferred text editor, put in your CSS and save the file as whatever.css. You can name it anything, as long as you save it as a .css document. Then add this code to your head tag:

The Code

You can also add the media="valuehere" attribute. You can use it to specify which media the stylesheet is made for, such as screen or print. In total there's ten different values to choose from. You can see the values here along with some descriptions of their purpose.

Comments

No comments yet

Add Your Comment



Notify me about new comments
Hide my email