How to display a list inline using Twitter's Bootstrap

前端 未结 9 1432
陌清茗
陌清茗 2021-01-29 21:46

I want to display a list inline using Bootstrap. Is there a class I can add from Bootstrap to achieve this?

相关标签:
9条回答
  • 2021-01-29 22:21

    I couldn't find anything specific within the bootstrap.css file. So, I added the css to a custom css file.

    .inline li {
        display: inline;
    }
    
    0 讨论(0)
  • 2021-01-29 22:22

    To complete Raymond's answer

    Bootstrap 2.3.2

    <ul class="inline">
      <li>...</li>
    </ul>
    

    Bootstrap 3

    <ul class="list-inline">
      <li>...</li>
    </ul>
    

    Bootstrap 4

    <ul class="list-inline">
      <li class="list-inline-item">Lorem ipsum</li>
      <li class="list-inline-item">Phasellus iaculis</li>
      <li class="list-inline-item">Nulla volutpat</li>
    </ul>
    

    source: http://v4-alpha.getbootstrap.com/content/typography/#inline

    0 讨论(0)
  • 2021-01-29 22:24

    I Amazed, list-inline wasn't working in bootstrap 4 then finally i got it in bootstrap 4 documentation.

    Bootstrap 3 and 4

    <ul class="list-inline">
      <li class="list-inline-item">Lorem ipsum</li>
      <li class="list-inline-item">Phasellus iaculis</li>
      <li class="list-inline-item">Nulla volutpat</li>
    </ul>
    

    Source: http://v4-alpha.getbootstrap.com/content/typography/#inline

    0 讨论(0)
提交回复
热议问题