IE cannot put padding on IMGs?

liunx

Guest
I'm trying to add some simple padding to an IMG by using a padding-right style, but it doesn't work in IE. Works fine in Mozilla and Opera, though.

Here's a link to a page which displays this IE problem:

<!-- m --><a class="postlink" href="http://home.comcast.net/~delerious1/index12.html">http://home.comcast.net/~delerious1/index12.html</a><!-- m -->

I do know that I can solve the problem in IE by changing padding-right to margin-right, but then the links cannot be clicked when the mouse is over that margin area. So I would really like to get the padding working in IE. Any ideas?Adding padding to images only doesn't work in IE 5.x/PC. I viewed your page in IE6 and it worked just like in Mozilla 1.5. IE 5's problem seems to stem from its incorrect implimentation of the CSS box model. IE5.x absorbs padding and borders into the width of an element instead of tacking it on in addition to the element's width.

Ditch the padding and instead put two non-breaking space HTML entities before the link text:

&nbsp;&nbsp;Link A</a>

That's probably the easiest fix.Use margin-right instead of padding-right, and it will work better.
 
Back
Top