css3 实现根据ul中li的个数设置li的宽度

<style>

    li{

        width:100%;

    }    

    li:first-child:nth-last-child(2),

    li:first-child:nth-last-child(2){

        width:50%;

    }

    li:first-child:nth-last-child(3),

    li:first-child:nth-last-child(3)~li{

扫描二维码关注公众号,回复: 471217 查看本文章

        width:33.3%;

    }    

</style>

猜你喜欢

转载自blog.csdn.net/Uncle_long/article/details/80276516