html - Bootstrap Column size -
i'm trying use bootstrap 2 separated columns (not in same row) have same height, height of bigger element (a picture).
my layout illustrated here: http://jsfiddle.net/v30u5zjd/
code:
<div class="row"> <div class="col-md-6"> <div class="row"> <div class="col-md-12 col-sm-height"> <img src="http://www.onlinegamblingbible.com/wp-content/uploads/2014/02/small-android_logo.png"></img> </div> </div> <div class="row"> <div class="col-md-12"> <h2 class="articlerecenttitre">my great title 1</h2> </div> </div> <div class="row"> <div class="col-md-12"> <h3 class="articlerecentresume"> excerpt here gregregfdsxgrezgttretgretregergfdqgregregregvcxgretgertrecdsgf'"t"'</h3> </div> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-12 col-sm-height"> <img src="http://letrainde13h37.fr/wp-content/uploads/authors/jeremie-patonnier.jpg"></img> </div> </div> <div class="row"> <div class="col-md-12"> <h2 class="articlerecenttitre">my great title 2</h2> </div> </div> <div class="row"> <div class="col-md-12"> <h3 class="articlerecentresume">description xaxaxaxaxaxaxaxaxacykaxaxaxafoobarxaxaoifherzoighbnfsoidgneorihgoierhgoihrsfoighvoierhgioreghoireh</h3> </div> </div> </div> </div>
i'd want each column containing picture size of biggest picture text can align nicely.
i don't think can use different row/column layout (putting 2 pictures in same row) because put them in right place (along texts) if 1 resizing view / using site on mobile.
something trick. add javascript page.
updated fiddle: http://jsfiddle.net/v30u5zjd/2/
$(document).ready(function () { var maxheight = 0; $("img").each(function () { if ($(this).height() > maxheight) { maxheight = $(this).height(); } }); $("img").height(maxheight); });
be careful though - scaling images larger original size make grainy images.
update -- check new fiddle instead. added code allow images remain responsive. need add img-responsive class images.
Comments
Post a Comment