Skip to content

Commit 44c09cc

Browse files
committed
Merge pull request #19234 from twbs/v4-w100
Add `.w-100` as width: 100% utility class
2 parents 18c2505 + 3165835 commit 44c09cc

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/components/utilities.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ Sometimes contextual classes cannot be applied due to the specificity of another
165165
{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
166166
{{ callout-include | markdownify }}
167167

168+
## Widths
169+
170+
Easily make an element as wide as its parent using the `.w-100` utility class, which sets `width: 100%`.
171+
172+
{% example html %}
173+
<img class="w-100" data-src="holder.js/200px100?outline=yes&text=Width%20%3D%20100%25" alt="Width = 100%">
174+
{% endexample %}
175+
168176
## Close icon
169177

170178
Use a generic close icon for dismissing content like modals and alerts. **Be sure to include text for screen readers**, as we've done with `aria-label`.

scss/utilities/_spacing.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Width
2+
3+
.w-100 { width: 100% !important; }
4+
15
// Margin and Padding
26

37
.m-x-auto {

0 commit comments

Comments
 (0)