-
flex-direction属性决定主轴的⽅向
值 | 描述 |
---|---|
row | 默认值。主轴为水平⽅方向,起点在左边。 |
row-reverse | 主轴为水平⽅方向,起点在右边。 |
column | 主轴为垂直方向,起点在上面。 |
column-reverse | 主轴为垂直方向,起点在下面。 |
-
示例
<!DOCTYPE html>
<html lang="en">
<head>
<Meta charset="UTF-8">
<Meta name="viewport" content="width=device-width, initial-scale=1.0">
<Meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.flexTest {
display: flex;
flex-direction: row;
height: 1000px;
}
.item {
width: 100px;
height: 100px;
margin: 10px;
background: #c3c3c3;
}
</style>
</head>
<body>
<div class="flexTest">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
</div>
</body>
</html>
-
row
-
row-reverse
-
column
-
column-reverse
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。