CSS Examples

Here you will find CSS tricks and tips, mostly derived from problems I needed to solve at one time or another, or questions that I had from vistors to #html on Undernet IRC.

An excellent CSS reference can be found at http://www.meyerweb.com/eric/css/references/css2ref.html. It's actually just an indexed version of the W3's CSS2 reference page.

<div> and <span>

The differences between <div> and <span> aren't readily apparent to the untrained eye. This simple example should make it more apparent.

Centering Content

<DIV ALIGN="CENTER"> is dead. So is the use of tables to position non-tabular content. Unfortunately, current browsers don't always correctly implement the new CSS techniques for centering, and even when they do it's not readily obvious how to do it (at least, it wasn't for me). This page shows how to accomplish centering.