<!DOCTYPE html>
<html>
<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;
}
.flex-container {
background-color: lightgrey;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
}
.flex-item {
background-color: cornflowerblue;
width: 300px;
height: 100px;
margin: 10px;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">flex item 1</div>
<div class="flex-item">flex item 2</div>
</div>
</body>
</html>
两个弹性盒自适应屏幕宽度
最新推荐文章于 2023-09-14 18:36:20 发布