Daniel
问问题
1327 次
2 回答
4
使用以下 HTML,我能够重现您的问题:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
div.something img
{
display: inline;
border: none;
}
div.something a
{
border: 0;
}
</style>
</head>
<body>
<div class="something">
<a href="http://www.somelink.com">
<img src="images/someimage.jpg" alt="sometag" />
</a>
<a href="http://www.somelink.com">
<img src="images/someimage.jpg" alt="sometag" />
</a>
<a href="http://www.somelink.com">
<img src="images/someimage.jpg" alt="sometag" />
</a>
</div>
</body>
</html>
这样做的问题是,开始“a”标签的结尾和“img”标签的开头之间的空白被认为是链接的一部分。
将那些替换为:
<a href="http://www.somelink.com"><img src="images/someimage.jpg" alt="sometag" /></a>
为我解决了 IE8 中的问题。
EDIT: Removed the CSS. Turned out not to be necessary.
于 2009-05-29T14:29:11.407 回答
1
您需要设置border="0"
您的图像标签,这将解决问题。当图片在链接内时,IE 会自动在其周围放置“链接”边框,以表明它是一个链接。
您也许还可以使用 CSS 将 img 标签的边框设置为 0
于 2009-05-29T14:14:37.240 回答