利用弹性盒模型实现图片布局
![实现图中效果里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0c43082eb09c6f089c68fd462886952f.png#pic_center)
在这里插入代码片<!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>
.wrap{
width: 300px;
height: 300px;
background-color: gray;
display: flex;
}
.wrap div{
width: 100px;
height: 100px;
background-color: white;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="wrap">
<div></div>
<div style="align-self: center;"></div>
<div style="align-self: flex-end;"></div>
</div>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/a52a5feeb49a4a4506223eabf81e49f6.png#pic_center)
在这里插入代码片<!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>
.wrap{
width: 300px;
height: 300px;
display: flex;
background-color: blanchedalmond;
flex-wrap: wrap;
justify-content: flex-end;
}
.wrap div{
width: 100px;
height: 100px;
background-color: coral;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="wrap">
<div></div>
<div></div>
<div></div>
<div style="align-self: flex-end;"></div>
</div>
</body>
</html>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/63db10b47635ce843aff00b33a955b9a.png#pic_center)
在这里插入代码片<!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>
.wrap{
width: 300px;
height: 100px;
background-color: cornsilk;
display: flex;
}
.w3{
width: 300px;
height: 100px;
background-color: cornsilk;
display: flex;
justify-content: center;
}
.w2{
width: 300px;
height: 100px;
background-color: cornsilk;
display: flex;
justify-content: space-between;
}
.wrap div{
width: 100px;
height: 100px;
background-color: darkkhaki;
border-radius: 50%;
}
.w2 div{
width: 100px;
height: 100px;
background-color: darkkhaki;
border-radius: 50%;
}
.w3 div{
width: 100px;
height: 100px;
background-color: darkkhaki;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="wrap">
<div></div>
<div></div>
<div></div>
</div>
<div class="w3">
<div></div>
</div>
<div class="w2">
<div></div>
<div></div>
</div>
</body>
</html>