You are here: Re: can't get css hover to work on link borders « HTML « IT news, forums, messages
Re: can't get css hover to work on link borders

Posted by Jonathan N. Little on 06/28/05 20:25

Els wrote:
> Lauri Raittila wrote:
>
>
>>in alt.html, Els wrote:
>>
>>>Lauri Raittila wrote:
>>>
>>>
>>>>in alt.html, Greg N. wrote:
>>>>
>>>>>Lauri Raittila wrote:
>>>>>
>>>>>
>>>>>>a:hover img {}
>>>>
>>>>As noted, don't work in IE, even if I thought it would.
>>>
>>>But it /does/ work in IE.
>>
>>That was my memory as well...
>>
>>
>>>I know there are some circumstances in which
>>>it may not work (I think we discussed this before some time), but in
>>>most cases it certainly does work in IE. Check the site in my sig and
>>>hover over thumbnails. You'll see the border change color, which is
>>>done by the a:hover img{} rule.
>>
>>I made testcase, and it didn't work. So it seems you might need to do
>>some tricks to make it works, and you may just well do them
>>accidentally..
>
>
> The trick I remember, is that you have to set the styles (colors
> only?) for the regular links too, earlier in the CSS file. Without
> that, it doesn't work on images in IE. (this is from memory though -
> about a year and a half back when I discovered why it worked/didn't
> work)
>
It does *not* work in IE. IE will only recognize the psuedo-class hover
on *A*s, thats way JavaScript hack are required for CSS fly-out list
menus to make them work of IE. A way around this for OP is to apply the
border change to the A tag. This works...

..left { float: left; }
..imga IMG { border: 0; vertical-align: bottom; }
a.imga { border: 2px solid green; }
a.imga:hover { border: 2px solid red; }

<a class="imga left" href="http://www.google.de"><img
src="http://coolhaus.de/misc/smily.gif" width=29 height=20></a>
<a class="imga left" href="http://www.google.de"><img
src="http://coolhaus.de/misc/smily.gif" width=29 height=20></a>


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация