aboutsummaryrefslogtreecommitdiff
path: root/docs/components
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-02-06 16:45:57 -0800
committerMark Otto <[email protected]>2016-02-06 16:45:57 -0800
commitb03684d04c143b59509bf626f065a331dcf8bd15 (patch)
tree54084f8e90f15bae47b9291ca39e2abab5b3e512 /docs/components
parent1285ec34fa9b5c2649cbb5b15de13ccfd1b14926 (diff)
parent442277ddce7a254d0b20aecaf88c2adbf437eb38 (diff)
downloadbootstrap-b03684d04c143b59509bf626f065a331dcf8bd15.tar.xz
bootstrap-b03684d04c143b59509bf626f065a331dcf8bd15.zip
Merge pull request #19102 from twbs/v4-center-utils
v4: Drop .center-block for new-ish .m-x-auto
Diffstat (limited to 'docs/components')
-rw-r--r--docs/components/utilities.md35
1 files changed, 13 insertions, 22 deletions
diff --git a/docs/components/utilities.md b/docs/components/utilities.md
index 00bc96721..e59869fcd 100644
--- a/docs/components/utilities.md
+++ b/docs/components/utilities.md
@@ -60,8 +60,19 @@ Here are some representative examples of these classes:
}
{% endhighlight %}
-Additionally, Bootstrap also includes an `.m-x-auto` class which sets the horizontal margins to `auto`.
+Additionally, Bootstrap also includes an `.m-x-auto` class for centering fixed-width block level content by setting the horizontal margins to `auto`.
+<div class="bd-example">
+ <div class="m-x-auto" style="width: 200px; background-color: rgba(86,61,124,.15);">
+ Centered element
+ </div>
+</div>
+
+{% highlight html %}
+<div class="m-x-auto" style="width: 200px;"">
+ Centered element
+</div>
+{% endhighlight %}
## Text alignment
@@ -191,27 +202,7 @@ Two similar non-responsive mixins (`pull-left` and `pull-right`) are also availa
}
{% endhighlight %}
-## Center content
-
-Set an element to `display: block;` and center via `margin`. Available as a mixin and class.
-
-{% example html %}
-<div class="center-block">Centered block</div>
-{% endexample %}
-
-{% highlight scss %}
-// Class
-.center-block {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
-
-// Usage as a mixin
-.element {
- @include center-block;
-}
-{% endhighlight %}
+## Clearfix
Easily clear `float`s by adding `.clearfix` **to the parent element**. Utilizes [the micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/) as popularized by Nicolas Gallagher. Can also be used as a mixin.