HTML/Html-practice/05-felx布局练习.html
2023-05-01 19:37:40 +08:00

195 lines
5.9 KiB
HTML

<!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>flex布局练习</title>
</head>
<style>
.main{
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: column;
}
.exercise-1{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
align-items: center;
justify-content: center;
}
.exercise-2{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
align-content: space-around;
align-items: center;
flex-wrap: wrap;
justify-content: space-around;
}
.exercise-3{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
justify-content: space-between;
}
.exercise-4{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
justify-content: space-between;
}
.exercise-5{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
justify-content: space-between;
}
.exercise-6{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
justify-content: space-between;
}
.exercise-7{
width: 500px;
height: 500px;
background-color: blue;
display: flex;
justify-content: space-between;
}
</style>
<body>
<div class="main">
<div class="exercise-1">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-2">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-3">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;align-self: flex-end;">
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-4">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;align-self: center;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;align-self: flex-end;">
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-5">
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-6">
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<div style="display: flex;align-content: center;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
</div>
<hr style="width: 100%;">
<div class="exercise-7">
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
<div style="display: flex;align-content: space-between;width: 150px;height: 500px;flex-wrap: wrap;">
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
<div style="width: 150px;height: 150px;background-color: aqua;">
</div>
</div>
</div>
</div>
</body>
</html>