flexbox

弹性基础 (Flex Basis)

The flex-basis property defines the size of the flex-item along the main axis of the flex container. The main axis is horizontal if flex-direction is set to row and it’ll be vertical if the flex-direction property is set to column.

flex-basis属性定义沿flex容器的主轴的flex-item的大小。 如果flex-direction设置为row ,则主轴为水平轴;如果flex-direction属性设置为column ,则主轴为垂直轴。

句法 (Syntax)

flex-basis: auto | content | <width> | <height>;

flex-basis:自动 (flex-basis: auto)

flex-basis: auto looks up the main size of the element and defines the size. For example, on a horizontal flex container, auto will look for width and height if the container axis is vertical.

flex-basis: auto查找元素的主要尺寸并定义尺寸。 例如,在水平伸缩容器上,如果容器的轴是垂直的,则auto将查找widthheight

If no size is specified, auto will fall back to content.

如果未指定大小,则auto将退回到content

flex-basis:内容 (flex-basis: content)

flex-basis: content resolves the size based on the element’s content, unless width or height is set through normal box-sizing.

flex-basis: content除非元素的widthheight是通过常规box-sizing设置的,否则content会根据元素的flex-basis: content解析box-sizing

In both the cases where flex-basis is either auto or content, if main size is specified, that size will take priority.

flex-basisautocontent两种情况下,如果指定了main size,则以该大小flex-basis

flex-basis: (flex-basis:)

This is just as specifying width or height, but only more flexible. flex-basis: 20em; will set the initial size of the element to 20em. Its final size will be based on available space, flex-grow multiple and flex-shrink multiple.

就像指定widthheight ,但是更加灵活。 flex-basis: 20em; 将元素的初始大小设置为20em 。 其最终大小将取决于可用空间, flex-grow倍数和flex-shrink倍数。

The specification suggests use of flex shorthand property. This helps write flex-basis along with flex-grow and flex-shrink properties.

该规范建议使用flex速记属性。 这有助于编写flex-basis以及flex-growflex-shrink属性。

例子 (Examples)

Here is rows of individual flex containers and individual flex elements showing how flex-basis affects the box-sizing.

这是单个flex容器和单个flex元素的行,它们显示flex-basis如何影响box-sizing

When the flex-direction is column, the same flex-basis will control the height property. You can see it in the example below:

flex-directioncolumn ,相同的flex-basis将控制height属性。 您可以在以下示例中看到它:

更多信息: (More Information:)

You can fund additional references about the flex basis property on the following pages:

您可以在以下页面上为有关弹性基准属性的其他参考提供资金:

  • CSS specification level 1

    CSS规范级别1

  • Mozilla Developer Network page on flex-basis

    flex-basis上的 Mozilla开发人员网络页面

有关Flexbox的更多信息: (More info on Flexbox:)

  • CSS Flexbox tips and tricks

    CSS Flexbox提示和技巧

  • Flexbox - the ultimate cheatsheet

    Flexbox-终极备忘单

翻译自: https://www.freecodecamp.org/news/flex-basis-property-in-flexbox/

flexbox

flexbox_Flexbox中的Flex基础属性相关推荐

  1. 控件中一些常用的属性和事件

    1.1常用基本属性 1)Name:表示控件的名称. 2)Enabled:表示控件是否可以对用户交互做出响应. 3)Font:表示控件中显示文字的字体格式,包括字体名称.字号以及是否以斜体.加粗和下划线 ...

  2. java吞食天地中武将_在FC吞食天地2里面,哪些武将的基础属性出乎玩家预料

    很多朋友都说,当年也不知道为什么,能对着一堆由马赛克组成的游戏一玩就是一整天,并且还能回味无穷.这其实就是那一代玩家的童年,那时红白机上的游戏,哪一个又不是那种画面呢?正是这些游戏,让我们的童年更加丰 ...

  3. 最佳答案 html5中不使用这些属性,[东北师范大学]《《HTML5开发基础与应用》2019年11月考试期末作业考核(100分)...

    试卷总分:100    得分:100 第1题,HTML5中具有boolean属性变更的元素不包括( ). A.true B.checked C.selected D.disabled 正确答案: 第2 ...

  4. ArcGIS Flex API 中的 Flex 技术(一)--事件

    作者:Flyingis 本文严禁用于商业目的,如需转载请注明作者及原文链接,其他疑问请联系:dev.vip#gmail.com 在ArcGIS Flex API中探索Flex使用是一种不错的学习方法, ...

  5. 爬虫基础-request的一些基础属性

    基础属性: 代码: import keyword import requests r = requests.get("http://www.baidu.com") r.encodi ...

  6. HTML中DOM对象的属性和方法的层级关系是怎样的?(目录即层次)

    HTML中DOM对象的属性和方法的层级关系是怎样的?(目录即层次) 一.总结 一句话总结:目录就是测试题 1.document取得元素(get element)的方式有哪几种? 解答:四种,分别是id ...

  7. WPF 使用依赖属性(DependencyProperty) 定义用户控件中的Image Source属性

    原文:WPF 使用依赖属性(DependencyProperty) 定义用户控件中的Image Source属性 如果你要自定义一个图片按钮控件,那么如何在主窗体绑定这个控件上图片的Source呢? ...

  8. linux中cooy命令_Linux:CentOS 7中常用的基础命令

    对于学习Linux系统来说,命令是必须熟练掌握的第一个部分.Linux系统中的命令有600多个,但常用的基础命令并不多.虽然不同版本的Linux系统的命令稍有不同,但命令的语法与使用方法基本相同,因此 ...

  9. pandas object转float_Pandas中文官档~基础用法6

    呆鸟云:"这一系列长篇终于连载完了,还请大家关注 Python 大咖谈,这里专注 Python 数据分析,后期呆鸟还会给大家分享更多 Pandas 好文." 数据类型 大多数情况下 ...

最新文章

  1. centos yum update 报错 Delta RPMs disabled because /usr/bin/applydeltarpm not installed 解决方法
  2. 多项式输出-Java
  3. python列表去掉特定项_python实现删除列表中某个元素的3种方法
  4. 数据挖掘技术在信用卡业务中的应用及实例分析
  5. linux 无线网卡连接网络连接不上去,【已解决】Ubuntu 10.04 无线网卡 无法连接
  6. Java会话技术之 —— cookie与session
  7. SAP License:SAP复制和默认快捷小贴士
  8. TrueCommand是什么
  9. java正则出现次数_正则表达式(二)—匹配次数的正则
  10. 2021-06-26数组详解
  11. 2021年中国开源优秀人物揭晓
  12. 什么软件可以测试手长,心率检测专家-可以让你通过按压手指检测出心率的健康app...
  13. android debug SIGABRT (signal SIGABRT)
  14. 基于CANoen协议实现DSP系统与上位机CAN的通讯
  15. Rational Rose2007的安装
  16. Beyond Compare 提示错误“这个授权密钥已被吊销”的解决办法
  17. JAVA中的deflate压缩实现
  18. 【数仓设计】宽表和窄表
  19. 编码——永不退色的计算机科学经典著作
  20. 雷达编程实战之信号处理流程

热门文章

  1. iir数字滤波器_手把手教系列之一阶数字滤波器设计实现(附代码)
  2. node.js 验证路径有效性_怎样识别光伏谐波路径?试试这个算法
  3. js 获取当前时间 随记
  4. 【iOS_Development】文件操作
  5. 长连接及在Node中的应用——HTTP/1.1 keep-alive
  6. iOS开发 关于启动页和停留时间的设置
  7. 哪些物联网应用最适合采用雾计算?
  8. Mybatis插件原理和PageHelper结合实战分页插件(七)
  9. 【Codeforces 738D】Sea Battle(贪心)
  10. onchange事件只生效一次的问题