CSS Mouse overs

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch

Harro

Established Member
Impact
1
I am doing a small image gallery. I have a border around the images, and on mouse over I want the border to change colour. Now I have got this working in Firfox but obviously I came across some problems in IE because it only supports :hover on the <a> tag. This is the code im using:
HTML:
a img.gallery {
	width: 25%;
	height: 25%;
	border: 5px solid #8EA113;
	margin: 10px;
}

a:hover img.gallery {
	width: 25%;
	height: 25%;
	border: 5px solid #fff;
	margin: 10px;
}
I was wondering if anyone knows any fixes to get this working in IE. I have came up with a javascript solution, but I would rather hav it done in CSS because the page already has a fair amount of javascript.

Thanks for any help you can give me.
Harro ;)
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What you used should work..

But if it doesn't, just put the border on the link instead of the image?
 
1
Close
Hey, thanks for the suggestion, wouldn't you know it, putting the border on the <a> tag works in IE but then looks wrong in FF. I guess im going to have to make a different style sheet for IE if i cant find another way.

Thanks for the suggestion ;)
 
0
Close
Code:
.feat a:link,
.feat a:active,
.feat a:visited {
	border: 10px solid #d1dde9;
	display: block;
	width: 215px;
	height: 150px;
	text-decoration: none;
	overflow: hidden;
	}
.feat a:hover {
	border: 10px solid #b4cee7;
	}

That's from my site (www.css.la) and it works in FF and IE.
 
0
Close
Thanks for that, works a treat. Nice site by the way too. ;)
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Each character of a domain name in its own box, with how to type one of them
Bookmarks: see bookmarks without a label
You can now show only the bookmarks you have not labeled. Open the label filter in the Bookmarks tab of your account menu, or on your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back