【发布时间】:2018-03-25 09:45:29
【问题描述】:
据我所知,justify-items 和 justify-self CSS 属性在 CSS Grid 布局中使用,在 Flexbox 布局中没有任何影响(不像 名称相似但不同的justify-content 属性)。事实上,MDN 在justify-items 和justify-self 的文档中都说
在 flexbox 布局中,此属性被忽略
在Box Alignment in Flexbox 页面上有一整节标题为Flexbox 中没有justify-self。
然而,神秘的是,justify-items 文档列出了这两个可能的值:
justify-items: flex-start; /* Pack flex items from the start */ justify-items: flex-end; /* Pack flex items from the end */
如果您开始设置 justify-items 或 justify-self 属性,这些值也会在 Chrome 和 Firefox 等浏览器的开发者工具中显示为自动完成建议。
如果在 Flexbox 布局中忽略 justify-items 和 justify-self,为什么会存在这些值?他们是指定的吗?他们是做什么的?
【问题讨论】: