How to display a list inline using Twitter's Bootstrap

前端 未结 9 1444
陌清茗
陌清茗 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:18

    According to the Bootstrap documentation, you need to add the class 'inline' to your list; like this:

    • Item one
    • Item two
    • Item three

    However, this does not work as there seems to be some CSS missing in the Bootstrap CSS file referring to the class 'inline'. So additionally, add the following lines to your CSS file to make it work:

    ul.inline > li, ol.inline > li {
        display: inline-block;
        padding-right: 5px;
        padding-left: 5px;
    }
    

提交回复
热议问题