Forum Moderators: not2easy
html
<div id="content">
<p><div class="imgwrap floatright"><img src="#*$!.jpeg"></div>This is a bunch of text about widgets. This is a bunch of text about widgets. This is a bunch of text about widgets. This is a bunch of text about widgets. </p><p>This is about green widgets. This is about green widgets. This is about green widgets. This is about green widgets. This is about green widgets.</p>
</div>
In my CSS,
#content p{
margin: 20px 0 0 10px;
}.imgwrap {
width: auto;
height: auto;
margin: 0;
padding: 0;
border: 1px solid #000000;
}.floatright{
float: right;
}
My problem is, when I put the picture at the beginning of the 1st paragraph, the paragraph doesn't start with a left margin of 10px. It starts at 0px. The 2nd paragraph behaves like normal and start at 10px margin. This makes the alignment of all the paragraphs not in a straight line.
Can anyone help? Thank you.
Ps are a strange thing in that they are designed to self close when they encounter some new content. By that I mean block-level content.
Because of this, another solution (worse though) would be to just use a Div instead of a P.
And like encyclo seemed to be saying, you could use a span instead of a div, since images are inline.
[edited by: Xapti at 7:49 pm (utc) on May 23, 2007]
Content Content Content Content Content xx picture xx
Content Content Content Content Content xx picture xx
Content Content Content Content Content xx picture xx
Content Content Content Content Content xx picture xx
Content Content Content Content Content text for pict
Content Content Content Content Content Content Conte
Content Content Content Content Content Content Conte