Automatic Method:
You should now simply use: http://jigsaw.w3.org/css-validator/check/referer?profile=css3
Manual Method:
Typically if you want to dynamically link to a W3C Valid CSS page, we use this link:
http://jigsaw.w3.org/css-validator/check/referer
That’s perfect if you’re using ALL CSS2.1 as that’s the default checker, but if you implement even 1 CSS3 style you’ll fail validation. So, we can no longer use the referer method until CSS3 becomes highly supported to the mainstream.
Demo:
Code:
CSS
.hov{
display:block;
width:245px;
height:195px;
background:url(‘images/image1.png’)}.hov:hover{
display:block;
width:245px;
height:195px;
background:url(‘images/image2.png’)}
Change the background URL to your image locations and adjust the width and height appropriately.
XHTML
Change # to whichever URL you wish.
Avoid Flicker on Image Rollover
This happens because the 2nd image only loads on mouseover/hover. We can avoid this by preloading the images(s) and this can still be done non-JavaScript with CSS:
CSS
.preload{display:none}
XHTML
This will preload the images without showing them or messing up your design. Use this method to preload all secondary images (the images to be seen on rollover). This is a much more reliable and lightweight method than the JavaScript alternative.
That’s it. There is certainly more style and techniques you can add, but this is THE most minimal way to create a rollover image effect, if it’s possible to get simpler, let me know.
Enjoy.
Thanks, Bryan









