开发者

UL CSS issue with border

I am desperately trying to find a way to get this working. I have a menu that use images for links. But in IE and FF there is an annoying border around the image that I don't know how to get rid of.

Would you be able to quickly开发者_如何学编程 tell me the CSS attribute to avoid this effect.

Thanks in advance for your time.

Antonio


ul li img { border: 0 }


I believe you are talking about the implicit outline or border that are added to img elements within a tags.

The fix is simple:

a img
{
  border: 0 none;
  outline: 0 none;
}

The outline may no longer be necessary, I'm not sure if any browsers use outline for the effect any more.

Edit to add:

For some reason in FF/IE, the specificity of img or a is too low to override the default behavior.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜