Instead of clearing the entire `.dl-horizontal`, we've moved the
clearfix mixin to the `dd` level to solve two problems in one: empty
`dd`s mid-list, and empty `dd` as the last child.
Addresses a few old issues, including #2824, #3819, #3821, #4062,
#6707, and #7180.
Sorry that took so long :D.
margin-left: 10px;
}
-.dl-horizontal:before,
-.dl-horizontal:after {
- display: table;
- content: " ";
+.dl-horizontal dt {
+ float: left;
+ width: 160px;
+ overflow: hidden;
+ clear: left;
+ text-align: right;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
-.dl-horizontal:after {
- clear: both;
+.dl-horizontal dd {
+ margin-left: 180px;
}
-.dl-horizontal:before,
-.dl-horizontal:after {
+.dl-horizontal dd:before,
+.dl-horizontal dd:after {
display: table;
content: " ";
}
-.dl-horizontal:after {
+.dl-horizontal dd:after {
clear: both;
}
-.dl-horizontal dt {
- float: left;
- width: 160px;
- overflow: hidden;
- clear: left;
- text-align: right;
- text-overflow: ellipsis;
- white-space: nowrap;
+.dl-horizontal dd:before,
+.dl-horizontal dd:after {
+ display: table;
+ content: " ";
}
-.dl-horizontal dd {
- margin-left: 180px;
+.dl-horizontal dd:after {
+ clear: both;
}
hr {
}
// Horizontal layout (like forms)
.dl-horizontal {
- .clearfix(); // Ensure dl clears floats if empty dd elements present
dt {
float: left;
width: (@component-offset-horizontal - 20);
.text-overflow();
}
dd {
+ .clearfix(); // Clear the floated `dt` if an empty `dd` is present
margin-left: @component-offset-horizontal;
}
}