flexbox_Flexbox中的Flex基础属性
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
将查找width
和height
。
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
除非元素的width
或height
是通过常规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-basis
是auto
或content
两种情况下,如果指定了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.
就像指定width
或height
,但是更加灵活。 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-grow
和flex-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-direction
为column
,相同的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)Name:表示控件的名称. 2)Enabled:表示控件是否可以对用户交互做出响应. 3)Font:表示控件中显示文字的字体格式,包括字体名称.字号以及是否以斜体.加粗和下划线 ...
- java吞食天地中武将_在FC吞食天地2里面,哪些武将的基础属性出乎玩家预料
很多朋友都说,当年也不知道为什么,能对着一堆由马赛克组成的游戏一玩就是一整天,并且还能回味无穷.这其实就是那一代玩家的童年,那时红白机上的游戏,哪一个又不是那种画面呢?正是这些游戏,让我们的童年更加丰 ...
- 最佳答案 html5中不使用这些属性,[东北师范大学]《《HTML5开发基础与应用》2019年11月考试期末作业考核(100分)...
试卷总分:100 得分:100 第1题,HTML5中具有boolean属性变更的元素不包括( ). A.true B.checked C.selected D.disabled 正确答案: 第2 ...
- ArcGIS Flex API 中的 Flex 技术(一)--事件
作者:Flyingis 本文严禁用于商业目的,如需转载请注明作者及原文链接,其他疑问请联系:dev.vip#gmail.com 在ArcGIS Flex API中探索Flex使用是一种不错的学习方法, ...
- 爬虫基础-request的一些基础属性
基础属性: 代码: import keyword import requests r = requests.get("http://www.baidu.com") r.encodi ...
- HTML中DOM对象的属性和方法的层级关系是怎样的?(目录即层次)
HTML中DOM对象的属性和方法的层级关系是怎样的?(目录即层次) 一.总结 一句话总结:目录就是测试题 1.document取得元素(get element)的方式有哪几种? 解答:四种,分别是id ...
- WPF 使用依赖属性(DependencyProperty) 定义用户控件中的Image Source属性
原文:WPF 使用依赖属性(DependencyProperty) 定义用户控件中的Image Source属性 如果你要自定义一个图片按钮控件,那么如何在主窗体绑定这个控件上图片的Source呢? ...
- linux中cooy命令_Linux:CentOS 7中常用的基础命令
对于学习Linux系统来说,命令是必须熟练掌握的第一个部分.Linux系统中的命令有600多个,但常用的基础命令并不多.虽然不同版本的Linux系统的命令稍有不同,但命令的语法与使用方法基本相同,因此 ...
- pandas object转float_Pandas中文官档~基础用法6
呆鸟云:"这一系列长篇终于连载完了,还请大家关注 Python 大咖谈,这里专注 Python 数据分析,后期呆鸟还会给大家分享更多 Pandas 好文." 数据类型 大多数情况下 ...
最新文章
- centos yum update 报错 Delta RPMs disabled because /usr/bin/applydeltarpm not installed 解决方法
- 多项式输出-Java
- python列表去掉特定项_python实现删除列表中某个元素的3种方法
- 数据挖掘技术在信用卡业务中的应用及实例分析
- linux 无线网卡连接网络连接不上去,【已解决】Ubuntu 10.04 无线网卡 无法连接
- Java会话技术之 —— cookie与session
- SAP License:SAP复制和默认快捷小贴士
- TrueCommand是什么
- java正则出现次数_正则表达式(二)—匹配次数的正则
- 2021-06-26数组详解
- 2021年中国开源优秀人物揭晓
- 什么软件可以测试手长,心率检测专家-可以让你通过按压手指检测出心率的健康app...
- android debug SIGABRT (signal SIGABRT)
- 基于CANoen协议实现DSP系统与上位机CAN的通讯
- Rational Rose2007的安装
- Beyond Compare 提示错误“这个授权密钥已被吊销”的解决办法
- JAVA中的deflate压缩实现
- 【数仓设计】宽表和窄表
- 编码——永不退色的计算机科学经典著作
- 雷达编程实战之信号处理流程
热门文章
- iir数字滤波器_手把手教系列之一阶数字滤波器设计实现(附代码)
- node.js 验证路径有效性_怎样识别光伏谐波路径?试试这个算法
- js 获取当前时间 随记
- 【iOS_Development】文件操作
- 长连接及在Node中的应用——HTTP/1.1 keep-alive
- iOS开发 关于启动页和停留时间的设置
- 哪些物联网应用最适合采用雾计算?
- Mybatis插件原理和PageHelper结合实战分页插件(七)
- 【Codeforces 738D】Sea Battle(贪心)
- onchange事件只生效一次的问题