Clear

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manuel
    New Member
    • Oct 2006
    • 5

    Clear

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

    Manuel
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    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.

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      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

      Comment

      • manuel
        New Member
        • Oct 2006
        • 5

        #4
        Thank you so much for your help!

        Manuel

        Comment

        Working...