Jump to content

<div style="clear:both;">


enviromen

Recommended Posts

I never had to use 'clear' yet, but here is how I understand it.Let's say you have:

<img src='image.jpg' style='float: left;'>Lorem ipsum dolor sit amet, consectetur adipisicing elit,<div>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>

Above, all the Lorem ipsum text, including the div, will be shown at the right of that image since the image floats on the text's left side.

<img src='image.jpg' style='float: left;'>Lorem ipsum dolor sit amet, consectetur adipisicing elit,<div style='clear: both;'>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>

Now the div will jump under the picture because it doesn't allow anything floating on either side of it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...