How to avoid using <br style="clear-both" /> ?

Discussion in 'HTML & Website Design' started by yangyang, Jun 19, 2008.

  1. #1
    When styling floats sometimes I seem to be stuck with <br style="clear-both" /> and other means just don't work.

    Any idea? Dan? Thanks!
     
    yangyang, Jun 19, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    You never need to use <br style="clear: both" />
    Did you try just using clear: {left,right,both} in the div after where you used to use a br tag?

    For example;
    <div style="float: left;">
    etc.
    </div>
    <div style="clear: left;">
    this will clear
    </div>
     
    itcn, Jun 19, 2008 IP
  3. yangyang

    yangyang Banned

    Messages:
    757
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the heads-up. Yep I tried but sometimes seemed only <br style="clear:both" /> worked.
     
    yangyang, Jun 19, 2008 IP
  4. arwen54

    arwen54 Active Member

    Messages:
    632
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    60
    #4
    <br style="clear:both" /> is not valid code

    you can use <div style="clear:both;">&nbsp;</div>
     
    arwen54, Jun 20, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Then how come it is?
     
    blueparukia, Jun 20, 2008 IP