mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03:00
v5: .form-check layout changes (#29322)
* Scope .form-check-input layout to the .form-check parent * Remove margin-bottom from list-group-items in case they are label elements * document .form-check in input groups and list groups, and cleanup the no-label examples in the main .form-check docs
This commit is contained in:
@@ -198,13 +198,14 @@ Group checkboxes or radios on the same horizontal row by adding `.form-check-inl
|
||||
|
||||
## Without labels
|
||||
|
||||
Add `.position-static` to inputs within `.form-check` that don't have any label text. Remember to still provide some form of label for assistive technologies (for instance, using `aria-label`).
|
||||
Omit the wrapping `.form-check` for checkboxes and radios that have no label text. Remember to still provide some form of label for assistive technologies (for instance, using `aria-label`).
|
||||
|
||||
{{< example >}}
|
||||
<div class="form-check">
|
||||
<input class="form-check-input position-static" type="checkbox" id="blankCheckbox" value="option1" aria-label="...">
|
||||
<div>
|
||||
<input class="form-check-input" type="checkbox" id="checkboxNoLabel" value="" aria-label="...">
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input position-static" type="radio" name="blankRadio" id="blankRadio1" value="option1" aria-label="...">
|
||||
|
||||
<div>
|
||||
<input class="form-check-input" type="radio" name="radioNoLabel" id="radioNoLabel1" value="" aria-label="...">
|
||||
</div>
|
||||
{{< /example >}}
|
||||
|
||||
Reference in New Issue
Block a user