Web Design Programming Half-Life Counter-Strike Rainbow 6 E-Mail TunkeyMicket

CSS Tutorial -- Beginning CSS


   What is CSS? CSS stands for Cascading Style Sheets. Style sheets allow the user to format his web pages in a similar way you would format a WordTM document. With style sheets you can have the browser render HTML elements or elements with a certain ID or CLASS any way you like. You can position these elements anywhere on the screen. In the most basic sense, CSS can be used to change the color of your BODY text or change the size of link text.

   First you need to know some basic syntax of CSS. You can define styles for 5 types of elements. The five types of elements you can define a style for are as follows:

  • HTML tag
  • CSS Class
  • CSS ID
  • HTML tag with a Class
  • HTML tag with an ID

   You can also define a style inside an HTML tag. This form of styling pertains only to the tag in which you have included it in.

   The following is an example of a HTML tag with inline styling:

<FONT STYLE="color: red;">I'm Red</FONT>

   You can do the same thing by adding a style declaration to the HEAD section of your HTML file, like so:

<HTML>
<HEAD>
<TITLE>CSS Test</TITLE>
<STYLE>
     FONT { color: red; }
</STYLE>
</HEAD>
<BODY>
<FONT>I'm Red</FONT>
</BODY>
</HTML>

   The difference between the two is how they apply to the overall HTML file. The first example, inline styling, applies ONLY to the tag it is contained in. However the second example applies to ALL FONT tags in the HTML document.

   The next part of this tutorial covers how to creat CSS classes and apply them to a tag or a type of tags.



4