mirror of
https://github.com/jasny/bootstrap.git
synced 2026-04-24 03:00:49 -04:00
Improve form styles
Combining horizontal and vertical form Wells in forms Vertical align for checkbox/radio in label Smaller labels
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
// Make all forms have space below them
|
||||
form {
|
||||
margin: 0 0 @baseLineHeight;
|
||||
> *:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset {
|
||||
@@ -73,6 +76,11 @@ label textarea,
|
||||
label select {
|
||||
display: block;
|
||||
}
|
||||
label input[type="image"],
|
||||
label input[type="checkbox"],
|
||||
label input[type="radio"] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
// Mini reset for unique input types
|
||||
input[type="image"],
|
||||
@@ -513,3 +521,52 @@ select:focus:required:invalid {
|
||||
padding-left: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
// Smaller labels
|
||||
// --------------
|
||||
.small-labels {
|
||||
.control-group > label {
|
||||
width: 80px;
|
||||
}
|
||||
.controls {
|
||||
margin-left: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
// Combining horizonal and vertical forms
|
||||
// --------------------------------------
|
||||
|
||||
.form-vertical .form-horizontal {
|
||||
.control-group > label {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.form-horizontal .form-vertical {
|
||||
.control-group > label {
|
||||
float: none;
|
||||
padding-top: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.controls {
|
||||
margin-left: 0;
|
||||
}
|
||||
&.form-actions, .form-actions {
|
||||
padding-left: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.control-group .control-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
// Wells in forms
|
||||
// --------------
|
||||
|
||||
.horizontal-form .well {
|
||||
.control-group > label {
|
||||
width: 120px;
|
||||
}
|
||||
.controls {
|
||||
margin-left: 140px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
text-align: left;
|
||||
}
|
||||
// Move over all input controls and content
|
||||
.form-horizontal .controls {
|
||||
.form-horizontal .controls, .form-horizontal .well .controls, .small-labels .controls {
|
||||
margin-left: 0;
|
||||
}
|
||||
// Move the options list down to align with labels
|
||||
|
||||
Reference in New Issue
Block a user