I have the following situation: one image floated left. I am having trouble forcing one div(id="keywords") (containing a list) to go under the previous div(id="categories")(also containing a list), but without breaking the floating of the image (this is what happens if I do a clear:left before the latdiv) and should slip under the image if the list in the former div is large. Here is my html code:
<div id="container">
<img src="image-source" alt="Image" id="image-id">
<div id="media_type">
<h2>
Title
</h2>
</div>
<p>
<a href="some-url" target="_blank">Feed</a>
</p>
<div id="categs">
<b>Categories</b>
<ul>
<li>
category1
</li>
<li>
category2
</li>
</ul>
</div>
<!-- should go below image if first list is large enough -->
<div id="keywords">
<b>Keywords</b>
<ul>
<li>
keyword1
</li>
<li>
keyword2
</li>
</ul>
</div>
<div class="clear"></div>
<div id="will-go-bellow-image"></div>
</div>
and the css:
#container #image-id {
float: left;
height: 220px;
margin: 0 10px 10px 0;
width: 220px;
}
#categs > ul > li, #keywords > ul > li {
float: left;
margin-top: 10px;
}
#categs > ul, #keywords > ul {
list-style: none outside none;
}
Thanks, Adrian