I have a div wrapped around an image, like this:
<div class="containing-div">
<div class="image-wrapper">
<img src="image.jpg">
</div>
<div class="unrelated-stuff">
Blah blah blah.
</div>
</div>
Now, I expect image-wrapper
to take the size of the image, and no more. But it doesn't; it instead fills to the height of containing-div
. (See actual page here: http://holyworlds.org/new_hw/wallpapers.php )
My CSS is:
.image-wrapper{
float: left;
box-shadow: inset 0px 4px 10px black;
background-image: url('image.jpg');
}
.image-wrapper img{
visibility: hidden;
}
.unrelated-stuff{
float: left;
}
Now, it works just fine if I don't have a Doctype declared. But everything I've tried fails if I do.
How can I make image-wrapper
be the size of the image while still using <!doctype html>
?
Have you tried:
.image-wrapper {
display: inline;
}
Or:
.image-wrapper {
display: inline-block;
}
Or:
.image-wrapper {
float: left;
}
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