mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
add .btn-block for a full-width button option
This commit is contained in:
parent
16b4ac0d8f
commit
fe6a4b0b54
10
docs/assets/css/bootstrap.css
vendored
10
docs/assets/css/bootstrap.css
vendored
@ -3019,6 +3019,16 @@ button.close {
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.btn-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.btn-primary.active,
|
||||
.btn-warning.active,
|
||||
.btn-danger.active,
|
||||
|
@ -1439,26 +1439,34 @@ For example, <code>section</code> should be wrapped as inline.
|
||||
<p>IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled <code>button</code> elements, rendering text gray with a nasty text-shadow that we cannot fix.</p>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
|
||||
|
||||
<h2>Button sizes</h2>
|
||||
<p>Fancy larger or smaller buttons? Add <code>.btn-large</code>, <code>.btn-small</code>, or <code>.btn-mini</code> for two additional sizes.</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-large">Action</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-small">Action</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-mini">Action</button>
|
||||
</p>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
<div class="bs-docs-example">
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-large">Action</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-small">Action</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">Primary action</button>
|
||||
<button type="button" class="btn btn-mini">Action</button>
|
||||
</p>
|
||||
</div>
|
||||
<pre class="prettyprint linenums">
|
||||
<button class="btn btn-large" type="button">Large button</button>
|
||||
<button class="btn btn-small" type="button">Small button</button>
|
||||
<button class="btn btn-mini" type="button">Mini button</button>
|
||||
</pre>
|
||||
<p>Create block level buttons—those that span the full width of a parent— by adding <code>.btn-block</code>.</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="well" style="max-width: 400px; margin: 0 auto;">
|
||||
<button type="button" class="btn btn-large btn-block">Block level button</button>
|
||||
</div>
|
||||
</div>
|
||||
<pre class="prettyprint linenums"><button class="btn btn-large btn-block" type="button">Block level button</button></pre>
|
||||
|
||||
|
||||
<h2>Disabled state</h2>
|
||||
@ -1491,9 +1499,6 @@ For example, <code>section</code> should be wrapped as inline.
|
||||
</pre>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
|
||||
|
||||
<h2>One class, multiple tags</h2>
|
||||
<p>Use the <code>.btn</code> class on an <code><a></code>, <code><button></code>, or <code><input></code> element.</p>
|
||||
<form class="bs-docs-example">
|
||||
|
47
docs/templates/pages/base-css.mustache
vendored
47
docs/templates/pages/base-css.mustache
vendored
@ -1376,26 +1376,34 @@
|
||||
<p>{{_i}}IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled <code>button</code> elements, rendering text gray with a nasty text-shadow that we cannot fix.{{/i}}</p>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
|
||||
|
||||
<h2>{{_i}}Button sizes{{/i}}</h2>
|
||||
<p>{{_i}}Fancy larger or smaller buttons? Add <code>.btn-large</code>, <code>.btn-small</code>, or <code>.btn-mini</code> for two additional sizes.{{/i}}</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-large">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-small">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-mini">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
<div class="bs-docs-example">
|
||||
<p>
|
||||
<button type="button" class="btn btn-large btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-large">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-small btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-small">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
<p>
|
||||
<button type="button" class="btn btn-mini btn-primary">{{_i}}Primary action{{/i}}</button>
|
||||
<button type="button" class="btn btn-mini">{{_i}}Action{{/i}}</button>
|
||||
</p>
|
||||
</div>
|
||||
<pre class="prettyprint linenums">
|
||||
<button class="btn btn-large" type="button">{{_i}}Large button{{/i}}</button>
|
||||
<button class="btn btn-small" type="button">{{_i}}Small button{{/i}}</button>
|
||||
<button class="btn btn-mini" type="button">{{_i}}Mini button{{/i}}</button>
|
||||
</pre>
|
||||
<p>{{_i}}Create block level buttons—those that span the full width of a parent— by adding <code>.btn-block</code>.{{/i}}</p>
|
||||
<div class="bs-docs-example">
|
||||
<div class="well" style="max-width: 400px; margin: 0 auto;">
|
||||
<button type="button" class="btn btn-large btn-block">{{_i}}Block level button{{/i}}</button>
|
||||
</div>
|
||||
</div>
|
||||
<pre class="prettyprint linenums"><button class="btn btn-large btn-block" type="button">{{_i}}Block level button{{/i}}</button></pre>
|
||||
|
||||
|
||||
<h2>{{_i}}Disabled state{{/i}}</h2>
|
||||
@ -1428,9 +1436,6 @@
|
||||
</pre>
|
||||
|
||||
|
||||
<hr class="bs-docs-separator">
|
||||
|
||||
|
||||
<h2>{{_i}}One class, multiple tags{{/i}}</h2>
|
||||
<p>{{_i}}Use the <code>.btn</code> class on an <code><a></code>, <code><button></code>, or <code><input></code> element.{{/i}}</p>
|
||||
<form class="bs-docs-example">
|
||||
|
@ -99,6 +99,15 @@
|
||||
line-height: @baseLineHeight - 4px;
|
||||
}
|
||||
|
||||
// Block button
|
||||
.btn-block {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
.box-sizing(border-box);
|
||||
}
|
||||
|
||||
|
||||
// Alternate buttons
|
||||
// --------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user