CSS
CSS introduction
Stylesheets
CSS syntax
Classes and ID's
CSS Comments
BG properties
Text properties
Font properties
List properties
Border properties
Margin properties
Padding properties
Outline properties
Table properties
Dim properties
Class properties
Position properties
Pseudo classes
Pseudo elements
Media types
Summary

Programming

Programming intro
Java

Markup

First webpage guide
HTML
XHTML

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

Introduction to CSS

With CSS, you can specify the appearance, style, and layout of various elements on a webpage.

This lesson focuses on:

What you should already know

Before studying CSS, you should already have at least a basic understanding of HTML and/or XHTML. CSS is used to specify the overall appearance of webpages written in HTML/XHTML. To use CSS for this purpose, you should first have at least a basic understanding of webpage building.

If you need to study HTML, you can do so at our HTML section.

If you need to study XHTML, you can do so at our XHTML section.

What is CSS?

CSS stands for Cascading Style Sheets. It is a language designed to specify the overall appearance of webpages as well as the appearance and structure of the text and elements such as images and buttons on webpages and their layout. Styles can be specified with CSS using internal style sheet definitions which are placed right into HTML/XHTML code or in external files.

CSS is supported by all modern browsers including Firefox, Opera, Netscape, and Internet Explorer.

CSS and HTML

Not just a language all its own, CSS is a part of HTML. The first version of HTML to include CSS was HTML 4.0

CSS was added to HTML to solve a particular problem - the problem of the content of HTML documents not being separated from the layout of the documents. This problem arose when the two most popular web browsers (Netscape and Internet Explorer) continuously added new tags and attributes to the HTML specification. Without the use of formatting tags, the layout of an HTML document was supposed to be taken care of by web browsers. The original purpose of HTML tags was to specify the content that will appear on webpages, and not their layout. But this was no longer the case, as Netscape and Internet Explorer added to the HTML specification.

The World Wide Web Consortium (W3C) - the organization responsible for developing and maintaining standards on the world wide web created CSS to solve the problem of content not being separated from layout. While CSS should be used to specify the overall appearance of webpages as well as the appearance and structure of the text and elements such as images and buttons on webpages and their layout, HTML/XHTML should be used to specify the content on webpages.

What can be done with CSS?

There is alot you can do with CSS:

All this and much more can be done with CSS!

Practice

Online code editor
Practical examples
Practical exercises
Step-by-step tutorials

Reference

Terms glossary
Reference material

Rate this site

Rate this site
Visitor comments