]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
New width and height utils
authorMark Otto <markdotto@gmail.com>
Fri, 23 Dec 2016 00:37:18 +0000 (16:37 -0800)
committerMark Otto <markd.otto@gmail.com>
Fri, 23 Dec 2016 01:15:10 +0000 (17:15 -0800)
Adding 25%, 50%, and 75% to the mix for later use with cards

docs/utilities/sizing-and-positioning.md
scss/utilities/_spacing.scss

index 670b6f188b898c084a4932565ea0426413f46cf9..9e3f35ca1bd97b0a788315a3f82c640e2cac35cc 100644 (file)
@@ -21,15 +21,21 @@ The `.pos-f-t` class can be used to easily position elements at the top of the v
 
 ## Width and height
 
-Easily make an element as wide or as tall as its parent using the `.w-100` and `.h-100` utility classes.
+Easily make an element as wide or as tall (relative to its parent) our width and height utilities. Includes support for `25%`, `50%`, `75%`, and `100%`.
 
 {% example html %}
-<img class="w-100" data-src="holder.js/200px100?text=Width%20%3D%20100%25" alt="Width 100%">
+<div class="w-25 p-3" style="background-color: #eee;">Width 25%</div>
+<div class="w-50 p-3" style="background-color: #eee;">Width 50%</div>
+<div class="w-75 p-3" style="background-color: #eee;">Width 75%</div>
+<div class="w-100 p-3" style="background-color: #eee;">Width 100%</div>
 {% endexample %}
 
 {% example html %}
 <div style="height: 100px; background-color: rgba(255,0,0,0.1);">
-  <div class="h-100" style="width: 100px; background-color: rgba(0,0,255,0.1);">Full height</div>
+  <div class="h-25 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 25%</div>
+  <div class="h-50 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 50%</div>
+  <div class="h-75 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 75%</div>
+  <div class="h-100 d-inline-block" style="width: 120px; background-color: rgba(0,0,255,.1)">Height 100%</div>
 </div>
 {% endexample %}
 
index a8d8e0afb517d2fc2f2252853294e4dd853c64c3..9e1802c47cf2ebd3edb490679b0d7c512a6b88a2 100644 (file)
@@ -1,6 +1,13 @@
 // Width and height
 
+.w-25 { width: 25% !important; }
+.w-50 { width: 50% !important; }
+.w-75 { width: 75% !important; }
 .w-100 { width: 100% !important; }
+
+.h-25 { height: 25% !important; }
+.h-50 { height: 50% !important; }
+.h-75 { height: 75% !important; }
 .h-100 { height: 100% !important; }
 
 .mw-100 { max-width: 100% !important; }