Forum Moderators: not2easy

Message Too Old, No Replies

Space Between Floated IMG and Text

Padding doesn't work in IE

         

Max_Power

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

10+ Year Member



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.

MWpro

4:45 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



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


img.left {
float: left;
margin: 5px;
}

balam

5:34 pm on Feb 8, 2004 (gmt 0)

10+ Year Member



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...)