Prevent Twitter bootstrap empty
filling with next
value

前端 未结 5 2044
一向
一向 2020-12-16 10:04

Hello CSS gurus out there,

I love the twitter bootstrap, and I am prototyping a lot of projects based on it, I encountered this problem, where if the dd tag has no H

相关标签:
5条回答
  • 2020-12-16 10:23

    According to the developer, <dd> should never be empty (which I disagree).

    And I think he prefer users to add clearfix class to the <dd>s that might be empty.

    <dd class="clearfix"></dd>

    Update

    This fix is included after 3.2, see release note.

    0 讨论(0)
  • 2020-12-16 10:25

    I used this style override.

    .dl-horizontal > dd:after {
      display: table;
      content: "";
      clear: both;
    }
    
    0 讨论(0)
  • 2020-12-16 10:28

    Example:

    <dd><%= @route.id %>&nbsp;</dd>
    

    http://www.sitepoint.com/forums/showthread.php?442551-When-dd-%28in-a-definition-list%29-is-empty-below-content-is-pulled-upwards

    0 讨论(0)
  • 2020-12-16 10:41

    Maybe you can try just that:

    dd {
        display: inline-block;
    }
    
    0 讨论(0)
  • 2020-12-16 10:44

    If I'm interpreting this commit properly, this will be default behaviour in 3.0.0. Until then you can also try adding dl-horizontal as an alternative to simply clearfix.

    <dd class="dl-horizontal"></dd>
    
    0 讨论(0)
提交回复
热议问题