当前位置: 首页 > news >正文

css:flex:1;是谁的缩写

flex-grow:1;放大

flex-shrink:1;缩小

flex-basis: 0%;初始大小

flex: 1; 实际上是以下三个属性的组合:

  1. flex-grow: 1

    • 定义项目的放大比例(当容器有剩余空间时,该项目会按比例分配剩余空间)。

    • 值为 1 表示该项目会与其他 flex-grow 为 1 的项目均分剩余空间

  2. flex-shrink: 1

    • 定义项目的缩小比例(当容器空间不足时,该项目会按比例收缩)。

    • 值为 1 表示该项目会与其他项目等比例收缩

  3. flex-basis: 0%

    • 定义项目在分配多余空间之前的初始大小

    • 0% 表示忽略项目的原始尺寸(如 width),直接按 flex-grow 分配空间。

对比其他常见缩写

缩写形式等效属性用途说明
flex: 1;flex-grow: 1; flex-shrink: 1; flex-basis: 0%;项目均分剩余空间,忽略初始尺寸
flex: auto;flex-grow: 1; flex-shrink: 1; flex-basis: auto;项目按内容大小分配剩余空间
flex: none;flex-grow: 0; flex-shrink: 0; flex-basis: auto;项目不可伸缩,保持原始尺寸
flex: 2 1 100px;flex-grow: 2; flex-shrink: 1; flex-basis: 100px;自定义伸缩比例和初始尺寸

文章转载自:
http://ajc.hyyxsc.cn
http://barracks.hyyxsc.cn
http://aircraftman.hyyxsc.cn
http://anticipative.hyyxsc.cn
http://brimmer.hyyxsc.cn
http://apposite.hyyxsc.cn
http://barbellate.hyyxsc.cn
http://arborescent.hyyxsc.cn
http://antespring.hyyxsc.cn
http://bta.hyyxsc.cn
http://borosilicate.hyyxsc.cn
http://analogist.hyyxsc.cn
http://baculine.hyyxsc.cn
http://agrogorod.hyyxsc.cn
http://chordotonal.hyyxsc.cn
http://adullamite.hyyxsc.cn
http://calender.hyyxsc.cn
http://adagiettos.hyyxsc.cn
http://caterwaul.hyyxsc.cn
http://androgenize.hyyxsc.cn
http://caliber.hyyxsc.cn
http://amdg.hyyxsc.cn
http://asiatic.hyyxsc.cn
http://amebic.hyyxsc.cn
http://ahriman.hyyxsc.cn
http://abortionism.hyyxsc.cn
http://alcoranist.hyyxsc.cn
http://cariban.hyyxsc.cn
http://breadthwise.hyyxsc.cn
http://anchorage.hyyxsc.cn
http://www.dtcms.com/a/281044.html

相关文章:

  • compose、 pipe 组合函数实现
  • 20th Day| 235.二叉搜索树的最近公共祖先,701.二叉搜索树中的插入操作, 450.删除二叉搜索树中的节点
  • Postman + Newman + Jenkins 接口自动化测试
  • 使用canal同步分库分表数据,到 Elasticsearch
  • JavaScript事件
  • 【数据同化案例1】ETKF求解 Lorenz-63 模型的同化系统(完整MATLAB实现)
  • Java-特殊文件、日志技术
  • CherryStudio配置DeepSeek调用MCP服务实现任务自动化
  • Elasticsearch 9.x 搜索执行过程(源码解析)
  • AOP简化MyBatis分页:高效自动化方案
  • 第二十篇 Word文档自动化:Python批量生成、模板填充与内容修改,告别繁琐排版!
  • Web3 支付系统:面向企业和消费者的全面概述
  • 时间序列挖掘及建模
  • Linux系统集群部署模块之Keepalived双机热备
  • 使用SQLMAP的文章管理系统CMS的sql注入渗透测试
  • Java全栈工程师面试实录:从电商系统到AIGC的层层递进
  • WSF70N10G N 沟道 MOSFET 在蓝牙耳机中的应用分析
  • Linux获取CPU/GPU的温度
  • docker部署gbase8s(数据持久化)并用可视化工具管理
  • NuGet01-安装及使用
  • gRPC实战指南:像国际快递一样调用跨语言服务 —— 解密Protocol Buffer与HTTP/2的完美结合
  • 【GPIO】从STM32F103入门GPIO寄存器
  • Video Python(Pyav)解码一
  • 面试150 完全二叉树的节点数
  • 力扣73:矩阵置零
  • 20250715_Sneak_neuro 靶机复盘
  • 三种深度学习模型(LSTM、CNN-LSTM、贝叶斯优化的CNN-LSTM/BO-CNN-LSTM)对北半球光伏数据进行时间序列预测
  • 【15】MFC入门到精通——MFC弹窗提示 MFC关闭对话框 弹窗提示 MFC按键触发 弹窗提示
  • C++(STL源码刨析/stack/queue/priority_queue)
  • Linux操作系统之信号:保存与处理信号