<!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>Dmeo</title>
<style>
* {
margin: 0;
padding: 0;
}
/*
原盒子
.box {
height: 200px;
border: 15px solid red;
} */
/* 为解决脱标加入flex布局 */
.box {
display: flex;
/* justify-content: space-between; */
/* height: 200px; */
border: 15px solid red;
}
.box div {
/* 左浮动 */
float: left;
margin: 10px;
width: 100px;
height: 100px;
background-color: pink;
}
</style>
</head
11.flex布局解决浮动布局脱标问题
最新推荐文章于 2024-01-25 14:32:49 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)