在CSS Flex / Grid中使用`baseline`值和`justify-content`,`justify-items`或`justify-self`有意义吗?

问题描述 投票:2回答:1
MDN align-contentalign-contentjustify-contentjustify-content描述为它们的可能值之一。虽然justify-itemsjustify-itemsbaseline一起使用时很有意义,但我不知道它如何与baselinealign-itemsalign-selfjustify-content属性一起使用。您有什么建议吗?
css flexbox grid alignment
1个回答
1
投票
此处的MDN不准确,因为justify-items没有基线

如果检查justify-self,您会发现align-content没有justify-content

the actual Flexbox specification

在不久的将来,并且按照baseline的定义,我们将有更通用的方式来对齐元素,即使justify-content的值不是Value:  flex-start | flex-end | center | space-between | space-around
的无效值,也是如此

CSS Box Alignment Module Level 3


顺便说一下,新规范中的baselinejustify-contentValue: normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ] <content-distribution> = space-between | space-around | space-evenly | stretch <overflow-position> = unsafe | safe <content-position> = center | start | end | flex-start | flex-end ,但是此属性在实际的Flexbox规范中不存在(与baseline相同)

相关:justify-items

[https://drafts.csswg.org/css-align-3/#propdef-justify-items不接受Flexbox(justify-self)的In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?,但在align-content中接受


同样适用于CSS网格,但是您可以在此处找到baselinehttps://drafts.csswg.org/css-flexbox-1/#align-content-propertythe New Specification

实际上,我没有一个清晰的示例来说明具有这些属性的justify-items,但我可以肯定,在大多数情况下,它将考虑Spec中定义的后备值:

© www.soinside.com 2019 - 2024. All rights reserved.