谷歌浏览器和Safari浏览器在图片周围显示了一个边框,但我不想要。在Mozilla中没有边框。我已经查看了 CSS 和 HTML,但是找不到导致此问题的任何内容。
这是代码:
<tr>
<td class="near">
<a href="../index.html"class="near_place">
<img class="related_photo" />
<h4 class="nearby"> adfadfad </h4>
<span class="related_info">asdfadfadfaf</span>
</a>
...
CSS:
a.near_place {
border: none;
background: #fff;
display: block;
}
a.near_place:hover{
background-color: #F5F5F5;
}
h4.nearby {
height: auto;
width: inherit;
margin-top: -2px;
margin-bottom: 3px;
font-size: 12px;
font-weight: normal;
color: #000;
display: inline;
}
img.related_photo {
width: 80px;
height: 60px;
border: none;
margin-right: 3px;
float: left;
overflow: hidden;
}
span.related_info {
width: inherit;
height: 48px;
font-size: 11px;
color: #666;
display: block;
}
td.near {
width: 25%;
height: 70px;
background: #FFF;
}
抱歉,我之前复制了一些旧代码。这里是让我困扰的代码。
先行致谢。
border: none;
),那么我看不出问题可能是什么。你确定你没有使用一些旧的缓存版本吗? - thirtydotclass
之间缺少了一个空格。换句话说,<a href="../index.html"class="near_place">
应该改为<a href="../index.html" class="near_place">
。 - Jared<img/>
标签中加入src
了吗?我在Chrome中打开了一个test.html文件,并且加入了一张图片,它看起来很好。但是如果没有src
,它会显示一个带有灰色边框的白色框。我相信你的答案在下面(请参见sarcastyx)。 - Brett Pontarelli