<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<p>111111111111111</p>
<!-- <p>111111111111111</p>
<p>111111111111111</p> -->
</div>
</body>
<style lang="less" scoped>
div{
display: flex;
flex-wrap: wrap;
}
p{
width: 25%;
}
p:nth-child(4n+1):nth-last-child(-n+4),
p:nth-child(4n+1):nth-last-child(-n+4)~p{
color: red;
}
</style>
</html>
网友评论