您的位置:首页 > 其它

flexbox布局属性flex-direction属性的学习

2016-05-13 17:40 423 查看
<!DOCTYPE html>

<html>

<head>
<meta charset="UTF-8">
<title>伸缩布局flex-direction</title>
<style type="text/css">
#parent {
display: flex;
flex-direction: column;
}

#parent1 {
display: flex;
flex-direction: row;
}

#parent2 {
display: flex;
margin-top: 10px;
flex-direction: row-reverse;
}

#parent3 {
display: flex;
margin-top: 10px;
flex-direction: column;
}

#parent4 {
display: flex;
margin-top: 10px;
flex-direction: column-reverse;
}

#div1 {
width: 50px;
height: 50px;
background: blueviolet;
}

#div2 {
width: 50px;
height: 50px;
background: brown;
}

#div3 {
width: 50px;
height: 50px;
background: burlywood;
}
</style>
</head>

<body>
<div id="parent">
<div id="parent1">
flex-direction属性值为row的情况
<br />
<div id="div1">
1
</div>
<div id="div2">
2
</div>
<div id="div3">
3
</div>

</div>

<div id="parent2">
flex-direction属性值为row-reverse的情况
<div id="div1">
1
</div>
<div id="div2">
2
</div>
<div id="div3">
3
</div>

</div>

<div id="parent3">
flex-direction属性值为column的情况
<div id="div1">
1
</div>
<div id="div2">
2
</div>
<div id="div3">
3
</div>

</div>
<div id="parent4">

<div id="div1">
1
</div>
<div id="div2">
2
</div>
<div id="div3">
3
</div>

</div>
</div>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: