<display-outside>
<display-outside>
关键字指定了元素的外侧显示(display
)类型,即元素在流式布局中的角色。这些关键字用作 display
属性的值,且有作为单个关键字的旧式用法,或按第 3 级规范的定义与 <display-inside>
关键字中的值一同使用。
语法
示例
在下列示例中,片段元素(通常显示为行级元素)设置为 display: block
,故元素断入新行且在行向上扩张填充其容器。
HTML
html
<span>片段 1</span> <span>片段 2</span>
CSS
css
span {
display: block;
border: 1px solid rebeccapurple;
}
结果
规范
Specification |
---|
CSS Display Module Level 3 # typedef-display-outside |
浏览器兼容性
css.properties.display.block
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
block |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
css.properties.display.inline
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
inline |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.