<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=deice-width, initial-scale=1.0">
<title>flex</title>
<style>
* {
margin: 0;
padding: 0;
}
#wrap {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
width: 400px;
height: 400px;
background: wheat;
border: 1px solid black;
display: flex;
/* flex-direction: row; */
justify-content: flex-start;
align-items: center;
/* flex-wrap: wrap; */
align-content: flex-start;
flex-flow: row wrap;
/* display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-box-pack: start;
-webkit-box-align: center; */
}
.item {
width: 50px;
height: 50px;
background: ghostwhite;
text-align: center;
line-height: 50px;
/* flex-grow: 1; */
/* -webkit-box-flex: 1; */
}
#wrap>.item:nth-child(1) {
/* -webkit-box-flex: 4; */
/* flex-grow: 4; */
order: 3;
align-self: flex-end;
}
#wrap>.item:nth-child(2) {
order: 1;
}
#wrap>.item:nth-child(3) {
order: 5;
}
#wrap>.item:nth-child(4) {
order: 2;
}
#wrap>.item:nth-child(5) {
order: 4;
}
</style>
</head>
<body>
<div id="wrap">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
</div>
</body>
</html>
flex布局
最新推荐文章于 2023-06-16 14:25:52 发布