/    Sign up×
Community /Pin to ProfileBookmark

IE cannot put padding on IMGs?

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:

[url]http://home.comcast.net/~delerious1/index12.html[/url]

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?

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@toicontienDec 23.2003 — 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:

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

That's probably the easiest fix.
Copy linkTweet thisAlerts:
@pyroDec 23.2003 — Use margin-right instead of padding-right, and it will work better.
×

Success!

Help @delerious spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...