mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-06 04:08:22 +01:00
Documentation cleanup (inc. use of <input ... readonly> for static form controls example)
* Fix incorrect code indentation * Remove unnecessary vendor prefix for `box-sizing` - all modern browsers now support this unprefixed * Remove incorrect `<label>` and change static controls to readonly inputs * Allow `<img>` elements without `src` to allow for `holder.js` images used in the docs, which lack `src` and use `data-src` instead
This commit is contained in:
parent
ebf0c3104e
commit
f7f644a4e5
@ -9,6 +9,7 @@
|
|||||||
"html-valid-content-model": false,
|
"html-valid-content-model": false,
|
||||||
"id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
|
"id-class-ignore-regex": "(onclick|content|[a-z]+([A-Z][a-z])+)",
|
||||||
"id-class-style": "dash",
|
"id-class-style": "dash",
|
||||||
|
"img-req-src": false,
|
||||||
"img-req-alt": false,
|
"img-req-alt": false,
|
||||||
"indent-style": "spaces",
|
"indent-style": "spaces",
|
||||||
"indent-width": 2,
|
"indent-width": 2,
|
||||||
|
@ -225,9 +225,7 @@ Bootstrap's collapse class exposes a few events for hooking into collapse functi
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>hide.bs.collapse</td>
|
<td>hide.bs.collapse</td>
|
||||||
<td>
|
<td>This event is fired immediately when the <code>hide</code> method has been called.</td>
|
||||||
This event is fired immediately when the <code>hide</code> method has been called.
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>hidden.bs.collapse</td>
|
<td>hidden.bs.collapse</td>
|
||||||
|
@ -376,7 +376,7 @@ Be sure to add `.col-form-label` to your `<label>`s as well so they're verticall
|
|||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2">Checkbox</label>
|
<div class="col-sm-2">Checkbox</div>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
<label class="form-check-label">
|
<label class="form-check-label">
|
||||||
@ -569,14 +569,14 @@ Should you have no text within the `<label>`, the input is positioned as you'd e
|
|||||||
|
|
||||||
## Static controls
|
## Static controls
|
||||||
|
|
||||||
When you need to place plain text next to a form label within a form, use the `.form-control-static` class on an element of your choice.
|
If you want to have read-only fields in your form styled as plain text, use the `.form-control-static` class to remove the default form field styling and preserve the correct margin and padding.
|
||||||
|
|
||||||
{% example html %}
|
{% example html %}
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-2 col-form-label">Email</label>
|
<label for="staticEmail" class="col-sm-2 col-form-label">Email</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<p class="form-control-static">email@example.com</p>
|
<input type="text" readonly class="form-control-static" id="staticEmail" value="email@example.com">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
@ -591,8 +591,8 @@ When you need to place plain text next to a form label within a form, use the `.
|
|||||||
{% example html %}
|
{% example html %}
|
||||||
<form class="form-inline">
|
<form class="form-inline">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="sr-only">Email</label>
|
<label for="staticEmail2" class="sr-only">Email</label>
|
||||||
<p class="form-control-static">email@example.com</p>
|
<input type="text" readonly class="form-control-static" id="staticEmail2" value="email@example.com">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mx-sm-3">
|
<div class="form-group mx-sm-3">
|
||||||
<label for="inputPassword2" class="sr-only">Password</label>
|
<label for="inputPassword2" class="sr-only">Password</label>
|
||||||
@ -604,7 +604,7 @@ When you need to place plain text next to a form label within a form, use the `.
|
|||||||
|
|
||||||
## Disabled states
|
## Disabled states
|
||||||
|
|
||||||
Add the `disabled` boolean attribute on an input to prevent user interactions. Disabled inputs appear lighter and add a `not-allowed` cursor.
|
Add the `disabled` boolean attribute on an input to prevent user interactions and make it appear lighter.
|
||||||
|
|
||||||
{% highlight html %}
|
{% highlight html %}
|
||||||
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>
|
<input class="form-control" id="disabledInput" type="text" placeholder="Disabled input here..." disabled>
|
||||||
|
@ -96,8 +96,6 @@ On the rare occasion you need to override it, use something like the following:
|
|||||||
|
|
||||||
{% highlight scss %}
|
{% highlight scss %}
|
||||||
.selector-for-some-widget {
|
.selector-for-some-widget {
|
||||||
-webkit-box-sizing: content-box;
|
|
||||||
-moz-box-sizing: content-box;
|
|
||||||
box-sizing: content-box;
|
box-sizing: content-box;
|
||||||
}
|
}
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user