How do I remove the first empty column in a CSS grid?

前端 未结 3 1477
太阳男子
太阳男子 2021-01-20 07:21

I\'ve got an empty column at the start and can\'t work out why?

3条回答
  •  一个人的身影
    2021-01-20 07:50

    It's because of Clearfix class you've used on ul element. Clearfix adds :before and :after as a children, therefore CSS Grid consider them as items.

    Remove the clearfix and handle it with following style:

    float: left;
    width: 100%
    

提交回复
热议问题