html - dl(详细列表)在 bootstrap 4 中不起作用

标签 html css twitter-bootstrap twitter-bootstrap-4 bootstrap-4

dl ListView 在 bootstrap 4 中的工作方式与在 bootstrap 3 中的相同

HTML:

 <section class="landing">
      <div class="container">
        <dl class="dl-horizontal">
          <dt>col1</dt>
          <dd>col2</dd>
        </dl>
      </div>
    </section>

最佳答案

我遇到了完全相同的问题,并按照@Paulie_D 的建议使用 .row 类解决了它

这是我做的

 <section class="landing">
  <div class="container">
    <dl class="row">
      <dt class="col-sm-3">col1</dt>
      <dd class="col-sm-9">col2</dd>
    </dl>
  </div>
</section>

更新 您还可以添加文本左右对齐

 <section class="landing">
  <div class="container">
    <dl class="row">
      <dt class="col-sm-3 text-right">col1</dt>
      <dd class="col-sm-9 text-left">col2</dd>
    </dl>
  </div>
</section>

关于html - dl(详细列表)在 bootstrap 4 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39165766/

相关文章:

asp.net-mvc-3 - 如何在 MVC3/4 中将类属性添加到 Html.BeginForm() 以保留最小重载

css - Bootstrap Popovers 定位不正确

java - 网页表单提交数量有限

html - 试图理解 float 和文本

HTML/CSS 嵌套混淆

javascript - md-button 内的 Font Awesome 图标对齐

html - 在 bootstrap popover 中弹出 html 内容

javascript - 我如何从 HTML 元素触发自定义事件?

html - 水平下拉菜单在 Internet Explorer 10 中无法正确显示

jquery - Bootstrap .container 菜单中的全宽居中子菜单