練習(xí)flex相關(guān)屬性用法可以在瀏覽器開發(fā)者工具上練習(xí)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style>
.boxes{
width: 300px;
border: 1px solid;
display: flex;
}
.box1{
width: 100px;
height: 200px;
background-color: red;
font-size: 32px;
}
.box2{
width: 200px;
height: 300px;
background-color: green;
}
.box3{
width: 50px;
height: 100px;
background-color: blue;
font-size: 48px;
}
</style>
</head>
<body>
<div class="boxes">
<div class="box1">1</div>
<div class="box2">2</div>
<div class="box3">3</div>
</div>
</body>
</html>
可以設(shè)置在容器(.boxes)上的屬性
flex-direction
flex-wrap
flex-flow
justify-content
align-items
align-content
image.png
image.png
image.png
image.png
可以設(shè)置在容器(.box1,.box2,.box3)上的屬性
order
flex-basis
flex-grow
flex-shrink
flex
align-self
image.png
image.png