Main Axis - MDN Web Docs Glossary: Definitions of Web-related terms 编辑
The main axis in flexbox is defined by the direction set by the flex-direction
property. There are four possible values for flex-direction
. These are:
row
row-reverse
column
column-reverse
Should you choose row
or row-reverse
then your main axis will run along the row in the inline direction.
Choose column
or column-reverse
and your main axis will run top to bottom of the page in the block direction.
On the main axis you can control the sizing of flex items by adding any available space to the items themselves, by way of flex
properties on the items. Or, you can control the space between and around items by using the justify-content
property.
Learn more
Property reference
Further reading
- CSS Flexbox Guide: Basic Concepts of Flexbox
- CSS Flexbox Guide: Aligning items in a flex container
- CSS Flexbox Guide: Controlling Ratios of flex items along the main axis
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论