4 replies [Last post]
sagraham
Offline
newbie
Scotland, UK
Last seen: 17 years 12 weeks ago
Scotland, UK
Joined: 2003-10-30
Posts: 3
Points: 0

Hi,

I'm using CSS to make the borders on my images change colour on a hover - and very pretty it is too. Until I use an image with has an ALIGN element in it. Such as;

<a href="#"><img class="image" src="" width="100" height="100" border="0" align="left></a>

I also have CSS specified like so;

.image {border:1px solid #00456f;}
A:hover, A:active {color: #ff2900;}
A:hover .image, A:active .image {border:1px solid #ff2900;}

in this case if I roll-over the colour changes for the top 10% of the border in IE, although it's fine in NS. If I remove the ALIGN it's fine.

However, I can't remove the align, because it's someone elses code that is being generated from a DB and changing it would affect far too many pages.

Any one have a hack or solution that would help this?

Many thanks.

Scott Graham

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 6 days 10 hours ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Border rollover issues using ALIGN

Hi sagraham,
Well it works in Netscape Smile

Sorry I don't have a CSS solution for you but using javascript may help.

Quote:
<a href="#" >
<img onmouseover="javascript:this.style.borderColor='#ff2900'" onmouseout="javascript:this.style.borderColor='#00456f'" class="image" src="" width="100" height="100" border="0" align="left">
</a>

sagraham
Offline
newbie
Scotland, UK
Last seen: 17 years 12 weeks ago
Scotland, UK
Joined: 2003-10-30
Posts: 3
Points: 0

Border rollover issues using ALIGN

Thanks Tony

I'm still after an elegant CSS solution, but in the meantime the JavaScript will do nicely.

Cheers

Scott

JaGGeR
JaGGeR's picture
Offline
Regular
Last seen: 12 years 14 weeks ago
Timezone: GMT+8
Joined: 2003-10-03
Posts: 34
Points: 0

Border rollover issues using ALIGN

hi sagraham,

you could get some ideas in this [url=http://www.csscreator.com/css-node/
i just dont know if it could help but it is my usual observation on the behavior of IE when it comes to hover events.

hope this helps. Smile

--

sagraham
Offline
newbie
Scotland, UK
Last seen: 17 years 12 weeks ago
Scotland, UK
Joined: 2003-10-30
Posts: 3
Points: 0

Border rollover issues using ALIGN

Hi JaGGeR

Thanks for the tip.

Scott