Site hosted by Angelfire.com: Build your free website today!
Contents

* Getting started
- What are CSS?
* Some CSS tricks
* CSS cautions
* What is JavaScript?
* Some JavaScript tricks
* JavaScript cautions

[Home]
Well, as you no doubt have guessed, CSS stands for Cascading Style Sheets. It's a simple styling language you can use to enhance the visual presentation of your HTML documents. It has a very simple structure, which goes something like this:
SELECTOR {property: value}
where the selector is the HTML element you wish to add style to and there is a huuuge list of properties and their respective values. Somewhere else :). Try the Links section.
How do you add style sheets to your HTML documents? Well, there are several ways. You can link to an external stylesheet by using the following code:
<LINK REL=StyleSheet 
HREF="yourstylesheetname.css" 
TYPE="text/css"
MEDIA=screen>
in your <HEAD> section.
If you want to use a stylesheet that's on a different web site, you can use:
<STYLE TYPE="text/css" MEDIA="screen">
<!--
  @import url(http://www.whatever.com/style.css);
  @import url(/directory/someotherstyle.css);
  more style sheet code of your own
-->
</STYLE>
this, too, goes into the <HEAD> section :) Note that although you can add more CSS code in there, the @import statements must appear first.
Now, you can also embed your CSS code in your HTML document [in the <HEAD> section] with the following tags before and after it:
<STYLE TYPE=text/css MEDIA=screen>
<--
stylesheet code
-->
</STYLE>
But that's not all. You can inline style right in your HTML document [in the tag that you want to add style to]. This requires that you add <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> in your <HEAD> section. To inline style:
<TAG STYLE='StyleSheet code'></TAG>,
where TAG is the HTML tag you wish to add style to.
That's it for adding style. Now what is this MEDIA business? MEDIA is an attribute of the STYLE element that informs the browser of the style sheet's output device. There are several types of MEDIA: If you want to use more than one medium, you can use `all' or separate the ones you want by commas. Note that there is more on media in the CSS cautions section. Ready to learn some tricks?

[Previous page] [Next page]