Welcome to the CSS2 GUIDE!

November, 2001
(C)opyright 1998-2001, By Geoff Knagge

You are free to copy, mirror or otherwise publish this guide on the condition that you provide credit to me by name, and preferably with a link to, or the address of, this site.
This is intended as a guide only. Although I have worked closely with the specification while I made this guide, it should not be considered as official documentation of the CSS Level 2 specification. I cannot, and do not, guarantee that this guide is free from errors.

What this guide covers

This guide is written for Cascading Style Sheets, Level 2. At the time of writing, it was only a reccomendation and all of the features were not widely supported. CSS1 is supported by Netscape 4, IE 3 and newer versions of these and other browsers. It is advisable to keep this in mind when writing for CSS, to ensure most people can view your pages in a reasonable form.

This guide assumes that you are using CSS with HTML, and have a reasonable knowledge of what the various HTML objects are, and of basic desktop publishing terminology. However, style sheets can also be applied to other languages, such as XML.

Changes from CSS1

All CSS1 documents are valid CSS2 documents. These are some, but probably not all, of the changes :
  • The meaning of !important has changed slightly. Now, !important in a user's style sheet now has first preference.
  • Additional pseudo-classes are :hover, :active, :focus, :lang, :firstchild
  • Additional pseudo-elements are :before, :after
  • Additional selection methods includeadjacent elements, child, attributes, and the universal selector ( * ) is now used to select all elements
  • There is support for different media types, with new properties for aural and paged media
  • A number of new colour values are allowed, allowing you to specify the colours used in certain parts of the operating system.
  • all support for outlines, counters and tables is new.
  • all properties can take the inherit value
  • New properties include : border-top-style, border-right-style, border-bottom-style, border-left-style, font-size-adjust, font-stretch, text-shadow, quotes, min-width max-width, min-height, max-height, position, z-index, textdir, unicodebidi, overflow, clipping, visibility, cursor, marker-offset
  • The display property has many new values.

Other CSS sites

Download This Guide

This CSS guide will eventually be available for download in a ZIP file to allow you to access it off-line. This is probably your best option, so you can write your pages off-line while being able to refer to this guide.

(C)opyright, Geoff Knagge.
Continued use of this site indicates your agreement to the Conditions of use and Privacy Policy.