Grid布局实现列表等分排列

.list-wrap{
    display: grid;
    grid-template-columns:repeat(4,1fr);
    grid-gap: 10px;
}
.list-wrap .listItem{
    background-color: salmon;
    border-radius: 4px;
}
<ul class="list-wrap">
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
    <li class="listItem"></li>
</ul>

效果:

Copyright © 2020 Seven all right reserved,powered by Gitbook该文件修订时间: 2024-06-18 14:12:49

results matching ""

    No results matching ""