style="float: "

G

gerrymcc

I don't really understand the 'box model' yet. I know that each
element has a containing box, which may itself be contained in an
ancestor element's box. I believe that these boxes can be made to
'float' so that following elements flow around them. Suppose that I
have something like:

<img src="anImage.gif" style="float:left">
<p> some text that goes to the right of the image, but not below it
<p>
<hr>

Here I want the horizontal rule to go below the gif and the text, but
instead it may go below the text and to the right of the image. Is
there a way for me to ensure that the <hr> (or anything else I
specify) goes below the image?

Thanks,
Gerard
 
J

Jay

Suppose that I have something like:

<img src="anImage.gif" style="float:left">
<p> some text that goes to the right of the image, but not below it
<p>
<hr>

Here I want the horizontal rule to go below the gif and the text, but
instead it may go below the text and to the right of the image. Is
there a way for me to ensure that the <hr> (or anything else I
specify) goes below the image?

<div>
<img src="anImage.gif" alt="An Image" style="float: left">
some text that goes to the right of the image, but not below it
</div>
<br clear="left">
<hr>

There may be a better way though...

- J
 
L

Leif K-Brooks

<img src="anImage.gif" style="float:left">
<p> some text that goes to the right of the image, but not below it
<p>
<hr>

Here I want the horizontal rule to go below the gif and the text, but
instead it may go below the text and to the right of the image. Is
there a way for me to ensure that the <hr> (or anything else I
specify) goes below the image?

In your CSS:

hr {
clear : left;
}
 
B

brucie

in post <[email protected] said:

<img src="anImage.gif" style="float:left">
<p> some text that goes to the right of the image, but not below it
<p>
<hr>

Here I want the horizontal rule to go below the gif and the text

<p><img ... style="float:left">text text text</p>
<hr style="clear:left;">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top