how to align all my li on one line?

前端 未结 7 1229
灰色年华
灰色年华 2020-12-31 02:57

my CSS

ul{
overflow:hidden;
}
li{
display:inline-block;
}

my HTML

  • a
  • b
相关标签:
7条回答
  • 2020-12-31 03:49

    I'm would recommend it:

    <style>
        .clearfix {
           *zoom: 1;
        }
        .clearfix:before,
        .clearfix:after {
            content: " ";
            display: table;
        }
        .clearfix:after {
            clear: both;
        }
        ul.list {
           list-style: none;
        }
        ul.list li {
           display: inline-block;
        }
    </style>
    
    <ul class="list clearfix">
        <li>li-one</li>
        <li>li-two</li>
        <li>li-three</li>
        <li>li-four</li>
    </ul>
    
    0 讨论(0)
提交回复
热议问题