18

I'm trying to remove the image border in ie, but I get some strange behavior.

Here's my code:

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

But it's still not working, and IE debugger shows me image border: medium. And my div is larger by 10px per image.

KyleMit
  • 30,350
  • 66
  • 462
  • 664
Kein
  • 977
  • 2
  • 12
  • 32
  • Duplicate of http://stackoverflow.com/questions/7910209/how-to-remove-borders-around-links-in-ie – dplass Feb 09 '13 at 20:27
  • 1
    @dplass: How can this be a duplicate of a question that was asked *after* this one? If anything, that one should be a dupe of this one. – Robusto Jul 29 '13 at 19:15

4 Answers4

42

Try

img {
  border-width: 0;
}
Robusto
  • 31,447
  • 8
  • 56
  • 77
8

Remove border from image link:

a img
{
     border:0px;
}

Works fine on IE

Faisal
  • 1,907
  • 1
  • 22
  • 29
  • 2
    I believe your solution is much better and is exactly pointing to the error. Thankyou – Dr TJ Oct 23 '13 at 08:43
3

there is no value 'none', use border: 0 instead

zuups
  • 1,140
  • 1
  • 11
  • 17
0

This fix is included in Eric Meyer's Reset CSS, you might be interested:

/* 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}
cprcrack
  • 17,118
  • 7
  • 88
  • 91