CSS, Background Images, and Rollovers
It occurred to me that this ought to be possible by reassigning a container's background-image property when it is :hover-ed.
Source: Images and thumbnails, a pure CSS hack (via dbagg: Items by Time)
<p>Yup, and you can do the same for every other pseudo-class of an anchor tag. I read about this via <a href="http://www.oreillynet.com/pub/a/javascript/2001/03/23/rollovers.html">Eric Meyer’s article</a> on the O‘Reilly Network. I’m still very much a <span class="caps">CSS</span> neophyte, but it’s helped me incredibly at work, where I was able to create a site layout with one set of <span class="caps">HTML</span> pages styled by a small library of <span class="caps">CSS</span> files for look & feel.</p>
<p>Yeah, yeah, that’s what it’s for, you say. But it surprised the hell out of me that I was able to abuse background image properties of containers to create JavaScript-free rollovers, as well as select between completely different image-based layout elements. This isn’t pure utopian <span class="caps">CSS</span> that I’m doing, and most of my position is still with tables, but thanks to blank pixel images atop <span class="caps">CSS</span>-controlled background images, I can do what I think are amazing things.</p>
<p>Now I just have to break free of the rest of my <span class="caps">HTML</span> crutches, circa 1996.</p>
shortname=css_rollovers
Archived Comments
The strange implementation of CSS in Internet Explorer is one of my greater headaches. Just wait until you start trying to position elements using float.
(PS: I'm the anthony from the FC list, found your site linked from Greg's)