By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,463 Members | 774 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,463 IT Pros & Developers. It's quick & easy.

Clear

P: 5
How does clear work and what exactly is it used for?
Thank you,

Manuel
Oct 11 '06 #1
Share this Question
Share on Google+
3 Replies


drhowarddrfine
Expert 5K+
P: 7,435
Floated elements are removed from the normal flow of a html document. If you had a div to contain floated elements, then the div would collapse and allow the floated elements to appear outside the box. In order to get that parent div to expand and contain the floated ones, you need to "clear the floats".

Note that all modern browsers do this properly but IE, as usual, does not and it is a bug in IE.
Oct 11 '06 #2

drhowarddrfine
Expert 5K+
P: 7,435
Ack! Got interrupted while I was reading your post and went off on the wrong topic.

'clear' is used to keep floated elements from residing on one side of another element. Without clear, an element may rise up to a previous non-positioned element because the float is removed from the normal flow, as stated above. Adding clear will keep the element underneath the floated one.

clear
Oct 11 '06 #3

P: 5
Thank you so much for your help!

Manuel
Oct 11 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.