html - Make rectangular thumbnails square for large screen size in a bootstrap grid -
i'm working on implementing data grid of square images in bootstrap. 1 requirement grid remain square , images shrink on transition smaller screen widths. below have current implementation, works great large images, when try use image below size thumbnails appear square large screen widths. can 1 advise me on how adapt smaller images? have strong preference out adding css , if that's not possible i'd find minimally invasive solution.
html:
<div class="container">   <div class="row">      <div class="col-xs-6">       <a class="thumbnail" href="http://www.google.com"><img class="img-responsive img-rounded" src="http://www.op-art.co.uk/op-art-gallery/var/albums/your-op-art/gdharley_op-art_%2311.jpg?m=1382213140" /></a>     </div>      <div class="col-xs-6">       <a class="thumbnail" href="http://www.google.com"><img class="img-responsive img-rounded" src="http://www.op-art.co.uk/op-art-gallery/var/albums/your-op-art/gdharley_op-art_%2311.jpg?m=1382213140" /></a>     </div>    </div>    <div class="row">     <div class="col-xs-6">       <a class="thumbnail" href="http://www.google.com"><img class="img-responsive img-rounded" src="http://davidsimpson.me/wp-content/uploads/2014/04/icon1281.png" /></a>     </div>     <div class="col-xs-6">       <a class="thumbnail" href="http://www.google.com"><img class="img-responsive img-rounded" src="http://davidsimpson.me/wp-content/uploads/2014/04/icon1281.png" /></a>     </div>   </div> </div>      
smaller images need have 100% width therefore have use css code, add css class:
.full-width {     width:100%; }   and use in tag:
<img class="img-responsive img-rounded full-width" ... />      
Comments
Post a Comment