chrome / safari在图像周围显示边框 [英] chrome/safari display border around image

查看:129
本文介绍了chrome / safari在图像周围显示边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Chrome和Safari正在图片周围显示边框,但我不想要。 Mozilla没有边框。我已经看过CSS和HTML,我找不到任何正在修复它。

Chrome and Safari are displaying a border around the image, but I don't want one. There is no border in Mozilla. I've looked through the CSS and HTML, and I can't find anything that is fixing it.

这是代码:

<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;

}


$ b <这是给我麻烦的代码

Sorry, I copied some old code before. Here is the code that is giving me trouble

提前感谢

推荐答案

p>现在我不知道这是否是Chrome的错误,但灰色边框出现时,它找不到图像,图像的URL是破碎的,或者在你的情况下,src不在那里。如果您给图片一个正确的网址,浏览器找到它,边框就会消失。如果图像没有src,那么您需要删除高度和宽度。

Now I don't know if this is a bug with Chrome or not but the grey border appears when it can't find the image, the image url is broken or as in your case the src isn't there. If you give the image a proper URL and the browser finds it then the border goes away. If the image is to not have a src then you will need to remove the height and width.

这篇关于chrome / safari在图像周围显示边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆