首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >【说站】css中flex-direction属性是什么

【说站】css中flex-direction属性是什么

作者头像
很酷的站长
发布2022-11-24 17:07:55
发布2022-11-24 17:07:55
7880
举报

css中flex-direction属性是什么

1、flex-direction用来控制子项整体布局方向,是从左往右还是从右往左,是从上往下还是从下往上。

2、指定了内部元素是如何在flex容器中布局的,定义了主轴的方向(正方向或反方向)。

实例

代码语言:javascript
复制
.list1 {
    width: 27%;
    padding-top: 0.5rem;
    list-style: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 6rem;
}
 
.list1 .listbox {
    width: 100%;
    position: relative;
    padding-left: 0.2rem;
    left: 1.35rem;
    right: auto;
}

以上就是css中flex-direction属性的介绍,希望对大家有所帮助。更多css学习指路:css教程

本文教程操作环境:windows7系统、css3版,DELL G3电脑。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • css中flex-direction属性是什么
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档