Dropshadows

Hmm… looks like maybe I should start a “How to do it with CSS”-section on this site. The other day I had a closer look at rounded corners, and today I’ve added my way of adding a dropshadow to a box. I wanted to keep the XHTML as simple as possible, so all I did was wrap the box in another div. A semi-transparent PNG image is used for the shadow in the browsers that can handle it. I’m using a child selector to hide that rule from IE/Win, and the commented backslash hack to hide it from IE5/Mac. The IE browsers are given a GIF image with every other pixel set to transparent, checkerboard style.

Posted on July 28, 2003 in CSS