【问题标题】:How switch off image border in IEIE中如何关闭图片边框
【发布时间】:2023-04-11 08:12:02
【问题描述】:

我正在尝试删除 ie 中的图像边框,但出现了一些奇怪的行为。

这是我的代码:

img {border: none}
<img src="..." border="0" style="border: 0"/>

但它仍然无法正常工作,IE 调试器显示图像border: medium。而且我的 div 每张图片大了 10px。

【问题讨论】:

标签: html css internet-explorer


【解决方案1】:

试试

img {
  border-width: 0;
}

【讨论】:

    【解决方案2】:

    从图片链接中移除边框:

    a img
    {
         border:0px;
    }
    

    在 IE 上运行良好

    【讨论】:

    • 我相信您的解决方案要好得多,并且准确地指出了错误。谢谢你
    【解决方案3】:

    没有值'none',使用border: 0代替

    【讨论】:

      【解决方案4】:

      此修复包含在 Eric Meyer 的重置 CSS 中,您可能感兴趣:

      /* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
      html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-01-15
        • 2012-03-11
        • 1970-01-01
        • 2016-01-01
        • 2018-10-28
        • 1970-01-01
        • 2019-09-29
        相关资源
        最近更新 更多