Question

I'm tired of work with these kinds of divs :(.

I have 2 divs:

<div id="content">
  <div id="row_left"></div>
  <div id="row_middle"></div>
  <div id="row_right"></div>
</div>
<div id="bottom"></div>

css:

#content {
  overflow: hidden; width: 100%;
}

Content-div is including another 3 divs, which should stay horizontally.

#row_left, #row_middle, #row_rifht { float: left; width: 33%; }

The trouble is that bottom div doesn't stay refer to content-text. It's always on the same position, even when content-rows text is over. How can I repair it?

Was it helpful?

Solution

Try adding a div after content with the style:

clear: both; line-height: 0.1em;

And put an

&nbsp;

in it

OTHER TIPS

Try

...
<div id="bottom" style='clear:both'></div>

If you'd like to clear the floats without adding extra markup, put this in your CSS:

#content { zoom: 1; }
#content:after {
    clear: both;
    display: block;
    content: ".";
    height: 0;
    visibility: hidden;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top