为什么< a>标签坐下来< img>在屏幕上(仅限Firefox 4 + Chrome!)

我不确定这是否是最新的Firefox和Chrome中的故障/怪癖,但我有一个
<img>
标签被
<a>
标签封装,将图像转换为链接。 问题出现在链接的点击框位于图像下方。图像也是可点击的,但图像下方的死区也是可点击的。
<img>
有一个左下边距规则应用于它,我认为这是导致问题的原因,但我不明白为什么......我也尝试使用明确的
</img>
结束标签,因为它没有解决问题无论是。 Internet Explore 8按预期工作!不显示以下问题。它显示了图像下方的框,但在IE 8中无法点击死区。我认为它应该如何工作。 这是一张图片来澄清我的意思: 我刚刚添加了一条规则来限制所有
<a>
标签。 这是代码......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
    a
    {
        text-decoration: none;
        border: 1px solid #F00;
    }

    #testimg        {
        margin-left: 20%;
        margin-bottom: 25px;
    }
</style>
</head>
<body>
<div><a href="#"><img id="testimg" alt="" src="imgs/landing/popup_sendbtn.png" /></a></div>
</body>
</html>
这真让我抓狂!任何帮助,将不胜感激。     
已邀请:
<img>
下面的可点击区域是文本内容应该在
<a>
元素中的位置。 如果您只想要图像区域可点击,请将
<a>
设为相同的宽度和高度,使其为
display: block
,并将边距移至
<a>
a {
    display: block;
    width: /* width of your image */;
    height: /* height of your image */;
    text-decoration: none;
    margin-left: 20%;
    margin-bottom: 25px;
    border: 1px solid #F00;
}
    
你有img的保证金。将它们移动到标签,它可能会修复它。     

要回复问题请先登录注册