You can do such a thing with flex-box:
html
<body>
<div style="background-color: blue;"></div>
<div style="background-color: green;"></div>
<div style="background-color: red;"></div>
</body>
政务司司长
body {
display: flex;
flex-wrap: wrap;
}
div {
flex-basis: 280px;
height: 280px;
flex-grow: 1;
}
Flex容器上的flex-wrap: wrap;
将允许在项目不适合屏幕时对其进行包装.
在弹性项上的flex-grow: 1;
将确保项增长到适合可用宽度.