Bootstrap Tutorial - Stack different sized images keeping their size








The following code shows how to stack different sized images keeping their size.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
</head><!--from   w w w .  j a  v a  2s . c o  m-->
<body>
  <div class="container">
    <div class="row">
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/400x200" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/300x150" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/400x200" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/400x200" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/400x200" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/300x150" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/300x150" />
        </a>
      </div>
      <div class="col-xs-3">
        <a href="#" class="thumbnail"> <img
          src="http://placehold.it/300x150" />
        </a>
      </div>
    </div>
  </div>
  <!-- Post Info -->
  <div
    style='position: fixed; bottom: 0; left: 0; background: lightgray; width: 100%;'>
    About this SO Post <a
      href='http://stackoverflow.com/q/23837562/1366033'>Stack
      different sized images keeping their size</a><br />
    <div>
</body>
</html>

Click to view the demo