Welcome to WebmasterWorld Guest from

Forum Moderators: not2easy

Message Too Old, No Replies

Space Between Floated IMG and Text

Padding doesn't work in IE

11:21 am on Feb 8, 2004 (gmt 0)

New User

10+ Year Member

joined:Nov 14, 2003
votes: 0

How can I create space between an image that is floated and the text that is next to it? I'm testing a page design in the latest versions of Netscape, Opera, and IE. Giving the image padding is effective in Netscape and Opera, but not in IE.
4:45 pm on Feb 8, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Dec 29, 2002
votes: 0

Have you tried setting a margin on the image? For example:

img.left {
float: left;
margin: 5px;
5:34 pm on Feb 8, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:May 27, 2003
votes: 0

I didn't have this problem, as you can see in this thread [webmasterworld.com], but the image effect you want is what I'm doing with the image in that thread.

This is the CSS I've used:

.rightimage {
margin: .5em 4% .5em 10px;
padding: 5px;
display: inline;
float: right;
border: 3px solid red;

It's important to note that this does work (in IE6, NN7, O7) if the doctype is set to HTML4.01 Strict, but it doesn't work in IE6 if the doctype is Transitional. (Other doctypes? I dunno...)


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members