如何清除webkit中破碎的图像周围的边框? [英] How to remove borders around broken images in webkit?

查看:174
本文介绍了如何清除webkit中破碎的图像周围的边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我这个吗? WebKit浏览器会在禁用的图片周围留出灰色的1px边框。我需要删除的原因是电子邮件优化,当电子邮件客户端禁用图片。

Can anybody advise me on this? WebKit browsers keeps on putting a gray 1px border around disabled images. The reason I need this removed is for email optimization for when email clients have images disabled. Works fine in Firefox, but WebKit browsers keep showing the border.

我尝试过 border:none!important 随处可见包括内联,但Chrome / Safari正在固执。

I have tried border:none !important everywhere including inline, but Chrome/Safari are being stubborn.

编辑:这里是带有inline css的示例html

Here is sample html with inline css

<img style="outline:none;text-decoration:none;display:block;border:none;-webkit-border:0;" border="0" src="images/rm_bnk.gif" width="10" height="10" alt="test" />


推荐答案

没有办法删除它,

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hide Broken Image border</title>
  <style>
    body{
      background-color:azure;
    }
    .image-container{
      width:100px;
      height:100px;
      overflow:hidden;
      display:block;
      background-color:orange; /*not necessary, just to show the image box, can be added to img*/
    }
    .image-container img{
      margin:-1px;
    }
  </style>
</head>
<body>
  <span class="image-container">
    <img src="path-to-image" alt="I'm Broken :(" width="102" height="102">
  </span>
</body>
</html>


http://jsbin.com/OpAyAZa/1/edit

这篇关于如何清除webkit中破碎的图像周围的边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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