我在面板内工作,无法在 Bootstrap 中左对齐或删除水平列表的边距。

IE。

<div class="container">
  <div class="panel panel-primary">
    <div class="panel-heading">
      <h3 class="panel-title">
        <strong>testing</strong>
      </h3>
    </div>
    <div class="panel-body">
      <dl class="dl-horizontal">
        <dt>term 1</dt>
        <dd>foo</dd>
        <dt>term 2</dt>
        <dd>bar</dd>
      </dl>
    </div>
  </div>
</div>

https://jsfiddle.net/srzyL86g/

最佳答案

在这里解决了。冲田

.container dt,.container dd {
  width:auto;
  margin-left:auto;
  display:inline-block;
}
将此添加到您的 css 中。 Bootstrap 提供 dtdd widthmargin 你需要覆盖它。

关于css - 左对齐 dl-水平、dt 和 dd,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35497542/

10-12 00:10
查看更多