CSS实现间距相同 首尾无边距处理
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.wrap {
display: flex;
flex-wrap: wrap;
}
.wrap .list {
width: calc((100% - 30px) / 4);
background: #000;
height: 200px;
margin: 0 10px 10px 0;
}
.wrap .list:nth-child(4n+0) {
margin-right: 0;
}
</style>
</head>
<body>
<div class="wrap">
<div class="list"></div>
<div class="list"></div>
<div class="list"></div>
<div class="list"></div>
<div class="list"></div>
<div class="list"></div>
</div>
</body>
</html>