CSS Logical Properties and Values - CSS: Cascading Style Sheets 编辑
CSS Logical Properties and Values is a module of CSS introducing logical properties and values that provide the ability to control layout through logical, rather than physical, direction and dimension mappings.
The module also defines logical properties and values for properties previously defined in CSS 2.1. Logical properties define direction‐relative equivalents of their corresponding physical properties.
Block vs. inline
Logical properties and values use the abstract terms block and inline to describe the direction in which they flow. The physical meaning of these terms depends on the writing mode.
- Block dimension
- The dimension perpendicular to the flow of text within a line, i.e., the vertical dimension in horizontal writing modes, and the horizontal dimension in vertical writing modes. For standard English text, it is the vertical dimension.
- Inline dimension
- The dimension parallel to the flow of text within a line, i.e., the horizontal dimension in horizontal writing modes, and the vertical dimension in vertical writing modes. For standard English text, it is the horizontal dimension.
Reference
Properties for sizing
Properties for margins, borders and padding
border-block
border-block-color
border-block-end
border-block-end-color
border-block-end-style
border-block-end-width
border-block-start
border-block-start-color
border-block-start-style
border-block-start-width
border-block-style
border-block-width
border-color
(logical
keyword)border-inline
border-inline-color
border-inline-end
border-inline-end-color
border-inline-end-style
border-inline-end-width
border-inline-start
border-inline-start-color
border-inline-start-style
border-inline-start-width
border-inline-style
border-inline-width
border-start-start-radius
border-start-end-radius
border-end-start-radius
border-end-end-radius
border-style
(logical
keyword)border-width
(logical
keyword)margin
(logical
keyword)margin-block
margin-block-end
margin-block-start
margin-inline
margin-inline-end
margin-inline-start
padding
(logical
keyword)padding-block
padding-block-end
padding-block-start
padding-inline
padding-inline-end
padding-inline-start
Properties for floating and positioning
clear
(inline-end
andinline-start
keywords)float
(inline-end
andinline-start
keywords)inset
inset-block
inset-block-end
inset-block-start
inset-inline
inset-inline-end
inset-inline-start
Other properties
caption-side
(inline-end
andinline-start
keywords)overflow-block
overflow-inline
overscroll-behavior-block
overscroll-behavior-inline
resize
(block
andinline
keywords)text-align
(end
andstart
keywords)
Deprecated properties
offset-block-end
(nowinset-block-end
)offset-block-start
(nowinset-block-start
)offset-inline-end
(nowinset-inline-end
)offset-inline-start
(nowinset-inline-start
)
Guides
- Basic concepts of logical properties and values
- Logical Properties for sizing
- Logical Properties for margins, borders and padding
- Logical Properties for floating and positioning
Specifications
Specification | Status | Comment |
---|---|---|
CSS Logical Properties and Values Level 1 | Editor's Draft | Initial definition. |
Browser compatibility
In general:
- Firefox has support for the mapped properties — where there is a direct mapping from the physical to the logical version.
- Chrome, from version 69, has support for the mapped properties.
- Edge, from version 79, has the same support as Chrome.
- Firefox 66 introduces support for two value shorthands, also behind a flag in Chrome.
- Internet Explorer has no support.
See the individual property pages for full compatibility information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论