Bootstrap 4 - Center List

前端 未结 4 1095
误落风尘
误落风尘 2021-02-19 11:51

I am building an app with the Bootstrap 4 beta. This app is really basic at the moment and has a single inline list. I\'m trying to center this list horizontally in the middle o

4条回答
  •  天命终不由人
    2021-02-19 11:59

    If you want to use bootstrap classes then you can use row

    
    
    
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 5

    Otherwise, Simply text-align:center is enough.

    ul.list-inline {
      text-align: center
    }
    
    
    
    • Item 1
    • Item 2
    • Item 3
    • Item 4
    • Item 5

提交回复
热议问题