【问题标题】:Bootstrap UL with bullets带子弹的引导 UL
【发布时间】:2021-04-08 08:13:00
【问题描述】:

我需要一个带有项目符号的 ul,并在页面上加载了引导程序。我在页面上找不到如何使用引导程序执行此操作的单个示例(谷歌仅导致删除项目符号的示例,而不是显示项目符号)。有没有我应该添加的未记录的类?

我已经尝试添加

ul {
    list-style-type: disc !important;
}

什么都不做:https://jsfiddle.net/49kwo5pL/2/

文档 (http://getbootstrap.com/css/#unordered) 说您必须添加一个类来删除项目符号,但实际情况并非如此。

【问题讨论】:

    标签: html css twitter-bootstrap-3


    【解决方案1】:

    默认情况下,ul 具有 paddingmargin,Bootstrap 在其 CSS 中将其删除。

    所以尝试添加它。

    @import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
    
    
    ul {
        list-style-type: disc !important;
        padding-left:1em !important;
        margin-left:1em;
    }
    <link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
    <script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
    <ul>
        <li>Why</li>
        <li>are</li>
        <li>there</li>
        <li>no</li>
        <li>bullets?!?!?!!?!?!?</li>
    </ul>

    【讨论】:

      【解决方案2】:

      Bootstrap 也删除了左侧填充。将其添加回来以显示项目符号。

      ul {
          list-style-type: disc !important;
          padding-left: 1em;
      }
      

      https://jsfiddle.net/mblase75/49kwo5pL/3/

      【讨论】:

        【解决方案3】:

        接受的答案对我不起作用,但是经过小的调整后,我设法让它工作。可能这会帮助某人。谢谢。

        ul {
          padding-left: 1em !important;
          margin-left: 1em;
        }
        
        li {
          list-style-type: disc !important;
        }

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-03-08
          相关资源
          最近更新 更多