<!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>
.box1 {
display: grid;
justify-content: space-between;
grid-template-columns: repeat(auto-fill, 100px);
grid-gap: 10px;
width: 400px;
border: 1px solid red;
}
.box2 {
width: 100px;
height: 100px;
background-color: skyblue;
margin-top: 5px;
}
</style>
</head>
<body>
<div class="box1">
<div class="box2"></div>
<div class="box2"></div>
<div
使用grid布局解决flex布局最后一行不足的问题
最新推荐文章于 2024-04-27 21:35:02 发布