验证中...
Languages: CSS
Categories: Web开发技术
Latest update 2019-10-10 11:17
flex布局
Raw Copy
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title></title>
<style>
.parent {
width: 200px;
height: 150px;
background-color: black;
display: flex;
flex-flow: row wrap;
align-content: flex-start;
}
.row {
display: flex;
width: 100%;
flex-wrap: wrap;
align-content: flex-start;
}
.child {
box-sizing: border-box;
background-color: white;
flex: 1;
height: 50px;
border: 1px solid red;
}
.Grid {
display: flex;
width:1000px;
border: 1px solid #000;
}
.Grid-cell {
margin: 5px;
height: 200px;
background: #bbbbbb;
/* width: auto; */
flex: 1;
}
.Grid-cell.u-full {
flex: 0 0 100%;
}
.Grid-cell.u-1of2 {
flex: 0 0 50%;
}
.Grid-cell.u-1of3 {
flex: 0 0 33.3333%;
}
.Grid-cell.u-1of4 {
/* width: 25%; */
flex: 0 0 25%;
}
</style>
</head>
<body>
<div class="Grid">
<div class="Grid-cell u-1of4">...</div>
<div class="Grid-cell">...</div>
<div class="Grid-cell u-1of3">...</div>
</div>
<div class="parent">
<div class="row">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
<div class="row">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
<div class="row">
<div class="child"></div>
<div class="child"></div>
</div>
</div>
</body>
</html>

Comment list( 0 )

You need to Sign in for post a comment

Help Search