css - :hover ignored over margin -


strange hover problem in ie8 & 10, can't find anything... surely, i'm not first stumble upon it?

jsfiddle

html: <a href="#"><img style="border:0" src="image.png">text</a>  css: {border:1px solid silver} img {margin-right:30px} a:hover {border:1px solid red} 

in ie, when hover mouse on image or text, border changes red expected, when move mouse on space caused margin-right, border returns gray.

in firefox, border stays red wherever mouse on <a>.

since problem reproducible on jsfiddle, it's not caused bad <doctype>...

use display:inline-block; on anchor link or use padding-right on image instead of margin , work in ie


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -