Click here!

Upload    Contact    Home


R E S O U R C E S

HTMLStuff:

 
 
Home
Artist
Designer
Webmaster
Programmer
What's New
* Resources
 

 

 

External Style Sheets  

External style sheets can be used to apply a style to several Web pages or even an entire site. To use them, first, you have to make them... but you probably knew that already. Anyway, here's how to make an external style sheet.

1) Create a new file using Notepad or some other text editor. (Yes, there are style sheet editors available, but here, we learn how to do it the hard way.)

2) Set up your document with an opening <STYLE type="text/css"> tag and HTML comment tags.

3) Define your style(s) as explained in the "Global Styles" section.

4) Put in the closing comment and </STYLE> tags.

5) Save your file with the extension ".css". To do this in Notepad, first select "Save As" and then "All Files." Then, add the extension manually and save your file. That's it!

But how do you link to the file? You use a special tag that, interestingly enough, is called the <LINK> tag. The <LINK> tag goes in the head of any HTML document that you would like to apply your external style sheet to. It has no closing tag, and it's set up like this:

<LINK REL="stylesheet" href="example.css" TYPE="text/css">

All you really need to know is that the location of the style sheet you're linking to must be put in quotes following the "href=" attribute. The rest of the tag should be specified exactly as above. You can click here if you'd like to see the <LINK> tag at work. The HTML document which opens up in the new window doesn't contain a style sheet, but has one linked to it instead. Without the style sheet applied, it's just plain, black unmodified text.

Got all that? Great! Now, let's put it to work!

<<Back Next>>

Head on to:
Part 1: Introduction
Part 2: Inline Styles
Part 3: Global Styles
Part 4: Creating Classes
Part 5: Element IDs
Part 6: External Style Sheets
Part 7: Putting It All together
List of CSS Properties and Values

Back to Tutorial Menu
Back to Designer Main Page
Back To HTML Stuff Main Page

 

  News   Contact   Advertise   CD ROM   Search   Upload   Help   Home

Copyright © 2000 Tucows.Com Inc.
TUCOWS.Com Inc. has no liability for any content or goods on the TUCOWS site or the Internet, except as set forth in the terms and conditions and privacy statement.