Overview of Cascading Style Sheets

For a more detailed introduction to CSS please refer to the W3C get started guide. This tutorial is a brief overview of CSS to let you write your first CSS. The first thing you should know is that only browsers version 4 and above can see style sheets. Firefox and Internet Explorer also see some CSS differently, what makes creating a style sheet an exercise in keeping track of what will be seen by both, and/or writing JavaScripts to show different style sheets for each of the browsers.

Style sheets can be entered in an existing HTML page or created as separated files and referenced in a page in which you want to apply a style. The following line in italic and red color was created by a style inside the HEAD tag in this page. See the code below it to know how it was done.

A simple example

<TITLE>CSS overview</TITLE>
<STYLE type="text/css">
h3 { font-family: Arial; font-style: italic; color: red }

I could also have created a style file (a regular text file) and made reference to it in this page. See an example of how this could have been done in this page. As you can see creating basic CSS is easy to do.

Basic concepts

Let us now see the concepts which make it work:

You can use the Web Developers Virtual Library CSS page to create more advanced styles.

This page is maintained by Al Bento who can be reached at abento@ubalt.edu This page was last updated on February 28, 2010. Although we will attempt to keep this information accurate, we can not guarantee the accuracy of the information provided.