View Single Post
Old 02-24-2007, 03:47 PM   #1 (permalink)
chicgeek
Empress™
 
chicgeek's Avatar
 
Join Date: 08-19-04
Location: York, UK
Posts: 17,965
iTrader: 0 / 0%
Latest Blog:
My Favourite Poem

chicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest orderchicgeek is a web professional of the highest order
CSS Hover: Border and Background Colours

Desired situation: linked image, padding showing coloured background and border. On hover, the background and border will alter colour.

I've been playing with a piece of code, trying to get the effect to work properly in IE.

HTML Code:
<div id="main"> <a href="#"><img src="../images/grass.gif" border="0" class="highlight" /></a> </div>
Code:
#main a:link img, #main a:active img, #main a:visited img { position: relative; float: left; padding: 5px; background-color: #CAB08A; border: solid 1px #593524; margin: 0 10px 10px 0; } #main a:hover img { background-color: #6B947C; border: solid 1px #095959; }
The :hover applies only to a, as it should. The above code is pristine in FF and Dreamweaver. IE shows the colour change for a height of 10px (twice the padding, as if the image has no height), or not at all if I have more than one of the images occur successively.

Weird, huh? Suggestions welcome.
__________________
laura / chicgeek
soprano & web designer
laurakishimoto.ca
chıcgeeĸ @ flickr
chicgeek is offline   Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links