Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dl-horizontal float issue #3819

Closed
garysweaver opened this issue Jun 12, 2012 · 3 comments
Closed

dl-horizontal float issue #3819

garysweaver opened this issue Jun 12, 2012 · 3 comments
Labels

Comments

@garysweaver
Copy link

When you have a definition list with dl-horizontal in a widescreen fluid layout, and have empty dd's towards the bottom, things under the dl with dl-horizontal move up (float issue) and looking at it in firebug appears that the dl is only is as tall as the last populated dd in the dl in FF 13.0 in OS X 10.7.4.

Currently working around with a hack under the dl:

<div class="clearfix">&nbsp;</div>
@garysweaver
Copy link
Author

Ok, here is a possible better fix, borrowing part of what .clearfix does. The following could be added to .dl-horizontal:

.dl-horizontal {
  &:after {
    display: table;
    content: "";
    clear: both;
  }
}

So in less/type.less, that whole dl-horizontal definition would be:

// Horizontal layout (like forms)
.dl-horizontal {
  dt {
    float: left;
    width: 120px;
    clear: left;
    text-align: right;
    .text-overflow();
  }
  dd {
    margin-left: 130px;
  }
  &:after {
    display: table;
    content: "";
    clear: both;
  }
}

That seems like it works.

@garysweaver
Copy link
Author

Associated pull request: #3821

@mdo
Copy link
Member

mdo commented Jun 25, 2012

Closing as dupe of #3821.

@mdo mdo closed this as completed Jun 25, 2012
mdo added a commit that referenced this issue Jun 17, 2013
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.
stempler pushed a commit to stempler/bootstrap that referenced this issue Apr 11, 2014
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 twbs#2824, twbs#3819, twbs#3821, twbs#4062,
twbs#6707, and twbs#7180.

Sorry that took so long :D.
stempler pushed a commit to stempler/bootstrap that referenced this issue Nov 4, 2014
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 twbs#2824, twbs#3819, twbs#3821, twbs#4062,
twbs#6707, and twbs#7180.

Sorry that took so long :D.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants