Tuesday 09th of February 2010 01:09:58 AM

CSS Tutorials

CSS Tutorials

Welcome to the CSS Tutorials. In this section we cover Cascading Style Sheets, the powerful supplement to HTML that allows you complete control over the look of your websites. We'll show you how to create Cascading Style Sheets, and some of the cool tricks you can achieve with them.

For Beginners...

Introduction to CSS
This tutorial covers the basics: what are style sheets? How do I make a style sheet? It also shows some of the cool things you can do with style sheets.

CSS Units
A description of all the units that can be used with CSS, including lengths, percentages, colours and URL's.

For Intermediate Users...

Controlling Background Images and Colours
Learn how to use CSS properties to add background images and colour to your Web pages. Lots of neat tricks and examples are included!

Controlling Fonts with CSS
In this tutorial we take a look at how to control the fonts used in your page body text, using the various font properties that can be controlled with style sheets.

Controlling Text Appearance with CSS
This tutorial shows you how to control the layout of your text using the text properties available in CSS, such as line spacing and text alignment.

Making Lists Look Nicer with CSS
You can really go to town with HTML lists when you add a sprinkle of CSS! This tutorial shows you how to make your lists stand out from the crowd.

For Advanced Users...

CSS Positioning
This tutorial teaches you how to use CSS to position images, text, and other elements on your Web pages. Essential reading for anyone who wants to start using CSS for layout.


present for the element, the element will match the selector shown.Thus, in the following example, the first two IMGelements shown will match the preceding rule, whereas the third willnot, as illustrated by Figure 10-7:

P[class="directions"] {color: red;}P.directions {color: red;}DIV[ID="abc123"] {color: blue;}DIV#abc123 {color: blue;}

Obviously, the latter rule in each pair is much simpler to type and



Since the "inherent" line height of 12-point text is 12points, the preceding rule means that there will be an extra 4 pointsof space around each line of text in the paragraph. This extra amountis divided in two, with half going above each line, and the otherhalf below. While there is a distance of 16 points between the lines,this is an indirect result of how the extra space is apportioned.

Now let's look at a slightly more complex case. Take thefollowing example:

on the placement of the background image.

6.2.3.1. Keywords

Easiest to understand are thekeywords. They have the effects you'd expect from their names;for example, top right wouldcause the background image to be placed in the top right corner ofthe element. Let's go back to the small yin-yang symbol: