enviromen Posted May 7, 2006 Share Posted May 7, 2006 What is the meaning and function of this tag and attribute: <div style="clear:both;">ThanksPeter Link to comment Share on other sites More sharing options...
skym Posted May 7, 2006 Share Posted May 7, 2006 http://www.w3schools.com/css/pr_class_clear.asp Link to comment Share on other sites More sharing options...
enviromen Posted May 7, 2006 Author Share Posted May 7, 2006 http://www.w3schools.com/css/pr_class_clear.asp<{POST_SNAPBACK}> This <p><div style="clear:both;"></div><img...><img....><img....><img..><div style="clear:both; padding-bottom: 0.25em;"></div></p>was used in this website. http://welovekatebeckinsale.blogspot.com/ What does it do? Link to comment Share on other sites More sharing options...
skym Posted May 7, 2006 Share Posted May 7, 2006 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now