Hedge
Hedge

Reputation: 16748

Image filling vertical space in container

I've got a <div> with an image on the left side and some text on the right side. How can I achieve that the image always fills the vertical space?

This is how its supposed to look:

enter image description here

The parent's height will change in 3 steps using media queries.

Upvotes: 0

Views: 183

Answers (1)

Beaut
Beaut

Reputation: 124

This should make all images in your div reach from the top to the bottom.

<div id="content">
    <img src="source.jpg">
    Other div contents...
</div

#content img { 
    height: 100%;
}

Upvotes: 1

Related Questions