【问题标题】:Cant remove image border in ie9 [duplicate]无法在ie9中删除图像边框[重复]
【发布时间】:2012-08-09 11:29:08
【问题描述】:

可能重复:
Removing the image border in Chrome/IE9

图像周围有一个用蓝色包裹的边框。它是蓝色的...我尝试了一些解决方案,但边框图像并没有消失。

CSS:

<style type="text/css">
   a {outline : none;}
   a img {outline : none;}
   img {border : 0;}
   a:active, a:focus 
   { 
     outline: none; 
     ie-dummy: expression(this.hideFocus=true);
    }
</style>

这是我的 html 标记:

<p style="margin-left: 39%;margin-top: 23px;">
     <a  href="<?php echo $review[0]['link']; ?>" 
         target="_blank" style="border: none;text-decoration: none;">
         <img style="border: none;" 
              src="Images/Review/button_register_for_free.png"/>
     </a>
</p>

【问题讨论】:

    标签: html css


    【解决方案1】:

    尽管您有任何其他样式,但您应该需要的唯一规则是在图像上不设置边框。

    你几乎做到了:

    img {border : 0;}
    

    但应该是:

    img {border : none;}
    

    【讨论】:

    • 那不起作用...查看 html ,在 style 属性中
    • 这是 JS Fiddle 中的一个示例 - 您会看到图像周围没有边框:jsfiddle.net/Sohnee/5CmRW - 在 IE 9.0.8112.16421 中进行测试。如果您仍然卡住 - 也许您在示例中遗漏了一些样式规则。也许您可以创建一个显示问题的 JS Fiddle?
    【解决方案2】:

    某些浏览器会在链接内的图像周围显示边框,您可以使用以下方法将其移除:

    a img { border: none; }
    

    您可能还想删除链接的下划线,它看起来像图像的底部边框:

    a { text-decoration: none; }
    

    【讨论】:

      猜你喜欢
      • 2011-08-26
      • 2016-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-24
      • 1970-01-01
      相关资源
      最近更新 更多