删除img边框 [英] removing img border

查看:94
本文介绍了删除img边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个img边框的问题。我使用下面的代码为我的所有图像,但边框不会消失。有人可以告诉我正确的方法来删除img边框吗?

I have a problem with the img border. I am using the following code for all my images, but the border is not going away. Can someone tell me the correct way to remove the img border?

   <div class="mosaic-overlay">
   <img class="cover1"></div>

   .cover1  {width:300px;height:185px;
            float:left;background: url('/img/cover.jpg') 0px 0px; 
            border:0;}

非常感谢。

Erik

推荐答案

这是在某些浏览器中出现的默认特殊 c> img 元素没有指向图像的 src 属性或 src 属性

It's the default "special" border that appears in some browsers when an img element has no src attribute, or a src attribute pointing to an image that does not exist.

例如,请在IE9中查看: http:// jsfiddle.net/SdbNE/

For example, look at this in IE9: http://jsfiddle.net/SdbNE/

一个常见的解决方法是将 src 设为 blank.gif 档案

A common workaround is to set the src to a blank.gif file:

<img class="cover1" src="blank.gif" />

或者,只需使用 div

<div class="cover1"></div>

这篇关于删除img边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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