User Tools

Site Tools


css

CSS

Clearing floats

http://www.sitepoint.com/simple-clearing-of-floats/

Example of approach d):

  <div style="width: 300px; height: 70px; border: 1px solid #000">
    <div style="background: #9ff">BLOCK 1</div>
    <div style="overflow: auto /* hidden */">
      <div style="background: #f99; float: left">BLOCK 2</div>
      <div style="background: #9f9; float: left">BLOCK 3</div>
      <div style="background: #99f; float: left">BLOCK 4</div>
    </div>
    <div style="background: #ff9">BLOCK 5</div>
  </div>

BLOCK 1
BLOCK 2
BLOCK 3
BLOCK 4
BLOCK 5

css.txt · Last modified: 2011-09-23 18:50 CEST by dominik