mirror of https://github.com/twbs/bootstrap.git
Fix no-label checkboxes/radios
Because we use `position: absolute` on our inputs, when there’s no label the `.checkbox` ends up having no computed height. To avoid rendering errors when there’s no label text, we reset the `position` to `static` for normal rendering.
This commit is contained in:
parent
ed89be1f44
commit
d31ec33908
|
@ -179,12 +179,15 @@
|
||||||
margin-bottom: ($spacer * .75);
|
margin-bottom: ($spacer * .75);
|
||||||
|
|
||||||
label {
|
label {
|
||||||
// Ensure the input doesn't jump when there is no text
|
|
||||||
min-height: $line-height-computed;
|
|
||||||
padding-left: 1.25rem;
|
padding-left: 1.25rem;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
// When there's no labels, don't position the input.
|
||||||
|
input:only-child {
|
||||||
|
position: static;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.radio input[type="radio"],
|
.radio input[type="radio"],
|
||||||
|
|
Loading…
Reference in New Issue