flex 弹性布局 笔记

<style>

/*

flex-direction (即项目的排列方向)

flex-wrap (换行)

flex-flow ( flex-direction属性和flex-wrap属性的简写形式)

justify-content (项目的对齐方向)主轴

align-items (项目的对齐方向)测轴

align-content ( 多根轴线的对齐方式)

flex-direction: row | row-reverse | column | column-reverse;

flex-direction属性决定主轴的方向(即项目的排列方向)。

row(默认值):主轴为水平方向,起点在左端。

row-reverse:主轴为水平方向,起点在右端。

column:主轴为垂直方向,起点在上沿。

column-reverse:主轴为垂直方向,起点在下沿。

flex-wrap: nowrap | wrap | wrap-reverse;项目都排在一条线(又称"轴线")上。flex-wrap属性定义,如果一条轴线排不下,如何换行

flex-flow属性是flex-direction属性和flex-wrap属性的简写形式

justify-content属性定义了项目在主轴上的对齐方式 (项目的对齐方向)。

justify-content: flex-start | flex-end | center | space-between | space-around

align-items属性定义项目在交叉轴上如何对齐 (项目的对齐方向)。

align-items: flex-start | flex-end | center | baseline | stretch;

align-content属性定义了多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用

align-content: flex-start | flex-end | center | space-between | space-around | stretch;

*/

.container {

height: 200px;

background-color: red;

display:flex;

flex-direction:row;

justify-content:flex-end;

/* align-items:stretch ; */

align-content:center;

}

*{ border:black 1px solid; }

.item { background:blue;

color:white;

width: 50px;

/* height: 50px;*/

}

</style>

</head>

<body>

<div class="container">

<div class="item">Item 1</div>

<div class="item">Item 2</div>

<div class="item">Item 3</div>

</div>

相关推荐
我在北京coding几秒前
Element-Plus-全局自动引入图标组件,无需每次import
前端·javascript·vue.js
鱼 空3 分钟前
解决el-table右下角被挡住部分
javascript·vue.js·elementui
柚子81613 分钟前
scroll-marker轮播组件不再难
前端·css
你的人类朋友1 小时前
🫏光速入门cURL
前端·后端·程序员
01传说1 小时前
vue3 配置安装 pnpm 报错 已解决
java·前端·vue.js·前端框架·npm·node.js
小李飞飞砖1 小时前
React Native 组件间通信方式详解
javascript·react native·react.js
小李飞飞砖1 小时前
React Native 状态管理方案全面对比
javascript·react native·react.js
烛阴2 小时前
Python装饰器解除:如何让被装饰的函数重获自由?
前端·python
千鼎数字孪生-可视化3 小时前
Web技术栈重塑HMI开发:HTML5+WebGL的轻量化实践路径
前端·html5·webgl
凌辰揽月3 小时前
7月10号总结 (1)
前端·css·css3