I have a website with on the front page a div that is split up in two with the Twitter Bootstrap grid-system. Whenever the 2nd grid (span9
) is higher than the 1st (span3
), the image fills up the span9
beautifully (the images has width:100%
).
If I resize the page however, the text in the span3
takes up more lines and makes the whole div
higher than the image, resulting in the following:
Of course I want the image to fill up the complete height of the div, without stretching the image vertically (hey, it's not the 90s anymore!). However, I can't find out how to do this through CSS, without the image breaking out of the div in width.
What I want is that the image crops/clips from the right side and grows vertically every time the div gets less wide, but higher.
I tried setting up a fiddle, but because Bootstrap jumps to the mobile CSS in the small window, I can't replicate it unless you use fullscreen and resize your browser: Fiddle
Of course you can also just see it live.