]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
fixes #4935: properly comment responsive image techniques and add CSS tests to support
authorMark Otto <markotto@twitter.com>
Tue, 4 Sep 2012 00:35:35 +0000 (17:35 -0700)
committerMark Otto <markotto@twitter.com>
Tue, 4 Sep 2012 00:35:35 +0000 (17:35 -0700)
less/reset.less
less/tests/css-tests.html

index 3261124e0f8b98c5e992a193c988a2863bcd8800..2901a85c80ddb08c8432931874ecd2dd448e9e22 100644 (file)
@@ -77,9 +77,11 @@ sub {
 // -------------------------
 
 img {
-  max-width: 100%; // Make images inherently responsive
+  /* Responsive images (ensure images don't scale beyond their parents) */
+  max-width: 100%; /* Part 1: Set a maxium relative to the parent */
   width: auto\9; /* IE7-8 need help adjusting responsive images */
-  height: auto; // Make images inherently responsive
+  height: auto; /* Part 2: Scale the height according to the width, otherwise you get stretching */
+
   vertical-align: middle;
   border: 0;
   -ms-interpolation-mode: bicubic;
index 4715143397ac9d76cf7918dd330df78376e27be5..c0cb1485e983f4cb524d89b17af10e999e9def88 100644 (file)
 
 
 
+<!-- Responsive images
+================================================== -->
+
+<div class="page-header">
+  <h1>Responsive images</h1>
+</div>
+
+<div class="row">
+  <div class="span4">
+    <img src="http://placehold.it/600x600" height="200">
+  </div>
+  <div class="span4">
+    <img src="http://placehold.it/600x600">
+  </div>
+  <div class="span4">
+    <img src="http://placehold.it/600x600">
+  </div>
+</div>
+
+<br>
+
+<div class="row">
+  <div class="span4">
+    <img src="http://placehold.it/600x900" style="width: 200px;">
+  </div>
+  <div class="span4">
+    <img src="http://placehold.it/200x300">
+  </div>
+  <div class="span4">
+    <img src="http://placehold.it/600x600">
+  </div>
+</div>
+
+<br><br>
+
+
+
+
 <!-- Fluid grid
 ================================================== -->