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>

相关推荐
2601_9557600714 分钟前
如何用 Claude Opus 5 API 批量扩展长尾关键词和文章选题
前端·python·搜索引擎
KaMeidebaby19 分钟前
卡梅德生物技术快报|bli亲和力检测gst:告别批量跑胶:BLI实时酶切监测技术加速GST融合蛋白下游流程优化
前端·网络·数据库·人工智能·算法
bloglin9999937 分钟前
langchain 和 langgraph 和 react
javascript·react.js·langchain
触底反弹39 分钟前
🚀 删了数据刷新又回来?3 组件 × 4 回调 × 3 坑讲透 React 父子通信
前端·javascript·react.js
耳东小鹿2 小时前
对象常用方法
前端
程序员海军2 小时前
一个 AI 应用开发程序员的一天,都在屏幕前忙些什么?
前端·后端·程序员
程序员黑豆2 小时前
鸿蒙应用开发:Stack堆叠组件实战——实现微信消息角标效果
前端·harmonyos
夏幻灵2 小时前
浏览器原理深度解析:从输入 URL 到页面展现的全流程剖析
前端
会周易的程序员3 小时前
js-shm: 高性能 Node.js 共享内存模块
开发语言·javascript·c++·node.js·共享内存·shm
闲猫3 小时前
Agent工程实践:从WorkFlow到多Agent协作的落地笔记
java·服务器·前端