AlfieWebDevTips Homefor new and experienced developers
[Home Home] [Web Development Web Development ] [Code Generators Code Generators ] [Resources Resources ] [Contact Us Contact ] |WebDevTips Privacy Privacy |
Print This Page

You are here : Home - Web Development - Style Sheets - Guide - External Styles

External Style Sheets



External style sheets requires the creation of a new file. External style sheets don't require the <style type="text/css">  </style> tags. Once you create the file you save it as filename.css

Following on from the previous examples your .css file should contain something like this

B { 
color:red; 
text-decoration:underline; 

So all we have to do now is link to the style sheet using the following syntax.
<link rel="stylesheet" type="text/css" href="/PATH/TO/style.css"> which gets placed between <head>  </head> tags.

By placing the link in the head of all your pages your style sheet now controls the appearance of your whole site.

I can't think of anything to say against using external style sheets I use them all the time and have never had any trouble. I have seen other sites where they have perhaps removed the .css file which newer browsers ignore but Netscape 4x gives you an error page - you don't get the webpage instead you get an error message saying it can't find filename.css

That isn't really a style sheet problem more of a webmaster not paying attention problem :)

Now that we've taken care of the basics to get you started we will look at some common style elements you can control.



Why not discuss this article in our forum?






Google
 

[back to top of page]   

[labelled with icra -  - this link will open in a new window] [RSS Content]

[Copyright © WebDevTips]