【发布时间】:2011-06-12 04:52:36
【问题描述】:
Chrome 和 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;完成),那么我看不出问题出在哪里。你确定你没有使用一些旧的缓存版本吗? -
这应该没关系,但是您在引号和单词
class之间缺少一个空格。换句话说<a href="../index.html"class="near_place">应该是<a href="../index.html" class="near_place"> -
您是否尝试过在
<img/>标签中使用src?我在 chrome 中启动了一个 test.html,并带有一个看起来不错的图像。如果没有src,它会显示一个带有灰色边框的白框。我相信你的答案在下面(见 sarcastyx)。
标签: html css google-chrome safari mozilla