Johan
Johan

Reputation: 1

How to make my text box with 25% width and image with 75% width the same height?

I'm using standard bootstrap 3 but can't make an image and a text with a background color scale nicely together as a block. Any clues ?

<div class="row">
   <div class="col-xs-3">Lorem ipsim novarum.</div>
   <div class="col-xs-9 img-responsive"><img src="img/landscape.jpg" alt="sibe"></div>
</div>*

Upvotes: 0

Views: 260

Answers (2)

James King
James King

Reputation: 1917

Put the 'img-responsive' class on the image itself e.g:

<div class="row">
    <div class="col-xs-3">Lorem ipsim novarum.</div>
    <div class="col-xs-9"><img src="img/landscape.jpg" alt="sibe" class="img-responsive"></div>
</div>

Upvotes: 1

httpgio
httpgio

Reputation: 127

Make row your actual container. This way when the image height scales, the 'row' div will wrap it nicely. This means give row the background color. and float the image left, with a right margin.

Upvotes: 0

Related Questions