I have a set of images of unknown height. The code for each looks like this:
Code:
<div class="x">
<div class="a"><img src="foto.png" /></div>
<div class="b"></div>
</div>
I tried using display: block
for the image, and height: auto
for class x
.
I don't know why, but I'm getting the expected behavior on Firefox but not Opera 19.
In Firefox I get normal squares with random-height images -- one under one, depending on image height. In Opera I only get flat rectangle(s) and all I can see is top of the image, with the rest of it truncated.
How do I need to do this such that it works on all browsers?
CSS
.x
{
min-height: 200px;
}
.a img
{
display: block;
}
.b
{
display: none;
}