I have several div's that contain a floated image and an unordered list. I want both of these to be positioned side by side down the page.
The issue is, as the divs go down the page the whole thing falls apart. The images on the right start to go lower and lower and the list items go higher and higher up. Here is what I did.
.imageleft {
float: left;
margin-left: 0;
margin-top: 0;
}
.container-right {
display:inline;
padding-bottom: 10px;
width: 500px;
}
.container-left {
float:left;
padding-bottom: 10px;
width: 500px;
}
<div class="inline">
<div class="container-left">
<img alt="Image info" class="imageleft" src="someimage.png" />
<h3>
Title</h3>
<ul>
Sub title:
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
</ul>
</div>
<div class="container-right">
<img alt="Blah blah" class="imageleft" src="/another-image.png" />
<h3>
Title</h3>
<ul>
Sub heading
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
<li>
List item</li>
</ul>
</div>
</div>
I tried adding a div around the 2 divs but it doesn't seem to help. How can I prevent this undesired behavior?
Thanks for any tips!
You mean like this http://jsfiddle.net/efVjj/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With