Using Cascading Style Sheets (CSS)
Designing A Better Website
By: Jason J. Russo
Using Cascading Style Sheets (CSS)
Part I
My first article in a series of articles on designing a better website.
Why Style Sheets?
Simple, because by using Style Sheets you can have better control over
your websites overall look and feel. Not to mention cutting down the size
of your page, making it quicker to load. By creating a style sheet you can
control many aspects of your page like the fonts, hyperlinks, background colors,
images, and much more. Another benefit of style sheets is that they are bandwidth
friendly. You can create a simple text file, & upload it just like you would any
other webpage!
THE BASICS:
You'll want to place your CSS script inside the "<head>" tags of your
webpages. Personally, I wouldn't worry about it too much because hopefully the
vast majority of Internet users are using the more recent versions of either Netscape
Navigator or Internet Explorer, but if you're not; upgrade please! It's free and it
makes your web surfing a much more pleasurable experience.
To embed a style sheet you need to follow the following simple rule:
<STYLE TYPE="text/css">
HTMLTAG {itsproperty: &value;}
</STYLE>
<STYLE TYPE="text/css">
The Style tag tells the browser that it is no longer HTML rather CSS.
HTMLTAG:
Any html tag you can think of; BODY, FONT, HR, etc..
{itsproperty: &value;}:
All CSS properties must be inside "{}" tags, each property followed by a ":" and a
value followed by ";". Example:
<STYLE TYPE="text/css">
<!--//
H1 { color:red; font-family: Arial; font-size: 16pt; }
//-->
</STYLE>
What the above example states is that anything in the "<h1>" tags of your
webpage will have a text color of red, Arial font, and 16pt size. So rather
than typing "<H1><font color=red face=arial>text here</font>
</h1>" into your HTML code, all you have to do is type "<h1>your
text</h1>".