Note that there are some explanatory texts on larger screens.

plurals
  1. POContent in floated divs causes div below to drop
    primarykey
    data
    text
    <p>I'm displaying WordPress posts horizontally using floated divs. I've got it working fine, but when the divs move to a new row, if the paragraph text inside each floated div is too long, the div immediately below it drops. Furthermore, each floated div is affected by the length of the divs above it. </p> <p>How do I make them flow naturally without being affected by the heights of those above them? </p> <p>Here is my HTML for a single floated div:</p> <pre><code> &lt;div class="entry_column&gt; &lt;div class="entry"&gt; &lt;h2&gt;Entry title&lt;/h2&gt; &lt;p&gt;Entry excerpt...if this text gets too long, the div immediately below it gets pushed WAY down&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;br class="clearFloat" /&gt; </code></pre> <p>And here are the relevant CSS classes:</p> <pre><code> .entry_column { float: left; width: 50%; } .entry_column .entry { margin-right: 25px; } .clearFloat { clear: both; height:0; font-size: 1px; line-height: 0px; } </code></pre> <p>I tried everything I could think of for the clearing, but if I try to add clearing directly on the floated divs, I still can't get it to stop dropping. </p> <p>Hopefully the image explains this issue a bit better. The "More Music" box drops all the way down because of the length of the "Music Post Stand" div above it. </p> <p><a href="http://www.flickr.com/photos/orbit82/4261553098/" rel="nofollow noreferrer"><img src="https://farm5.static.flickr.com/4036/4261553098_3c24154e94.jpg" alt="Screenshot of problematic layout"></a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload