Okay, the problem is with the CSS and it’s the same one I had with my site. It’s mentioned in the Browser bugs article listed above, if I remember.
Called “Clearfix”, it’s from Positioniseverything’s Easy Clearing. Basically, it’s a CSS hack that gives instructions to a float inside of a float as to it’s height. Without these instructions, the images will overlap, as your tests show. Using a blank graphic doesn’t “fix” the problem it just gives you a temporary solution for that specific instance.
If you click my name and look at my site you will see on the front page images to the right of each summary. A green bar is on the left of the summary. Without this fix, if the text was short, the image would overlap the post below, causing the stairstep technique you experienced. This is because the container didn’t have instructions on how high it was supposed to be to accomodate the floating image inside.
With this fix, it provides the information and it works. I use a clear:both
in the excerpt’s style so that each excerpt summary begins “with a clean slate” of no floats above it.
Here is the code for the style.css
:
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-table;}
/* Hides from IE-mac */
* html .clearfix {height: 1%;}
/* End hide from IE-mac */
/* End clearfix */
To use it:
<div class="excerpt-post clearfix">
<h2 id="post-<?php the_ID(); ?>">......
You can use two styles in a class, by the way. I also use this in my book reviews and other places where I need to have the image float within the “paragraph” or container and not overlap the one below it.
On my front page, once this is in my index.php
template file, I never have to think about it again. That’s nice.
I hope this helps.