Style Sheets

"Style Sheets? Cascading Style Sheets, or CSS?,
Any of them. They all mean the same."

 

Implementing the Style Sheet

The implementation of the Style Sheets could be done in one of two ways:
  • Separate style sheet on each page
  • One style sheet, linked to all pages

One Style Sheet - One Page

This is the way, Style Sheets are beeing used more often. To place a Style Sheet on a Web page, the following rules apply:
  • It must be within the <HEAD> and </HEAD> commands
  • The text must be surrounded by <STYLE TYPE="text/css"> and </STYLE>
  • The style sheet is text, so if you just type ti on the page, it will show up and we can't have that. So, in addition to the style commands above, surround the text with <!-- and -->
The format would look like this:

<HEAD>
<STYLE TYPE-"text/css">
<!-- Style Sheet information goes in here... -->
</STYLE>
</HEAD>

One Style Sheet-Many Pages

The Syle Sheet will be a simple text file with a .css suffix. The suffix is required for browsers to recognize it as a style sheet rather than a simple mesh of letters.

The following command has to be placed on the page, to call for the Style Sheet:

  • <LINK REL=stylesheet HREF="http://www.yourpage/name.css" TYPE="text/css">
Here's what's happening:
  • LINK tells the browser what to be linked to the page
  • REL=stylesheet tells the browser that this link is relative to the page as a style sheet.
  • HREF="---" denotes where the browser will find the style sheet.
  • TYPE="text/css" tells the browser that what it is reading is text that will act as Cascading Style Sheet.
You could see an example here

Go to the top of the page.


[main] [contents] [conventions] [guide lines]
[html tags] [design] [navigation] [style sheets] [java script] [guest book]
Hosted by www.Geocities.ws

1