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.

In this image the flex-direction is row which forms the main axis

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:154 次

字数:2811

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文