Question

See http://www.martenminkema.nl

The layers of each entry only gain the height of the text that it contains. The height of the image isn't taken into account, resulting into troubles with some layout markup in some cases.

html:

<div id="entry-296" class="hentry entry gedachten">
<a href="http://www.martenminkema.nl/gedachten/2009/06/autobahnbar-1.html" rel="bookmark"><span class="date">12.06.09</span></a><h2 class="entry-title"><a href="http://www.martenminkema.nl/gedachten/2009/06/autobahnbar-1.html" title="Geplaatst onder Gedachten op 12 juni 2009 23:32 in de categorie(&euml;n): buitenland, met de volgende tags: berlijn">Autobahnbär</a></h2><div class="icoontje" title="Gedachten"><div class="linkwrapper transparent"><a href="http://www.martenminkema.nl/gedachten/2009/06/autobahnbar-1.html" class="clickable">&nbsp;</a></div></div>
<div class="entry-content">
<a href="http://www.martenminkema.nl/gedachten/Afbeeldingen/Autobahnb%C3%A4r-in-Berlijn.jpg" rel="lightbox" title="Beer aan de snelweg in Berlijn (foto: M. Minkema)"><img src="http://www.martenminkema.nl/gedachten/assets_c/2009/06/Autobahnbär-in-Berlijn-thumb-150xauto.jpg" width="150" height="112" alt="" class="icoon"/></a>
Beer met uitzicht, Tierpark Berlin op een vroege ochtend.</div>
</div>

css:

div.entry {
clear: both;
display: block;
font-size: 12px;
margin-bottom: 10px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
position: relative;
text-align: left;
width: 350px;
}

a[rel='lightbox'] {
color: black;
cursor: auto;
display: block;
font-size: 12px;
font-weight: bold;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 200px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
text-decoration: none;
width: 150px;
}

The lightbox link contains the image. The image height is given in the html, but according to my safari webdevelopment tools, the lightbox link doesn't gain the height of the image, resulting in that the div.entry layer only gets the height of the text and the image height isn't taken into account.

Any solution to that?

Thanks!

Was it helpful?

Solution

give the div overflow: hidden and make sure the DIV has a width.

OTHER TIPS

Your question is a bit unclear but gathering from experience you have an image inside your DIV that is floated to the left.

You can use a popular technique called the clearfix to make sure the outer DIV is the same height as the text and the image inside it.

Looking at the site you mention you can solve this as follows (notice i added the "clearfix" class):

<div class="entry-content clearfix">
<a href="...">
<img class="icoon" width="150" height="147" alt="" src="..."/>
</a>
Sommige verkeersborden krijgen een totaal andere lading als je ze een stukje kantelt.
</div>

The clearfix CSS code and an article that explains your problem can be found here:

http://www.positioniseverything.net/easyclearing.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top