MDN align-content, justify-content and justify-items describe baseline as one of their possible values. While baseline makes sense when is used with align-items or align-self, I don't get how it could work along with justify-content, justify-items, justify-self and align-content properties. Do you have any suggestions? 解决方案 The MDN is not accurate here as there is no baseline for justify-contentIf you check the actual Flexbox specification you will see that there is no baseline value for justify-contentValue: flex-start | flex-end | center | space-between | space-aroundIn the near future and as defined in the CSS Box Alignment Module Level 3 we will have more generic way to align elements and even there baseline is a not a valid value of justify-content Value: 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-endBy the way, there is baseline for justify-items in the new specificiation: https://drafts.csswg.org/css-align-3/#propdef-justify-items but this property doesn't exist in the actual Flexbox specification (same for justify-self)Related: In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?align-content doesn't accept baseline with Flexbox (https://drafts.csswg.org/css-flexbox-1/#align-content-property) but it does in the New SpecificationThe same apply for CSS grid but you can find justify-items and justify-self there: https://www.w3.org/TR/css-grid-1/#row-alignActually I don't have a clear example to illustrate the baseline with those properties but I am pretty sure in most of the case it will consider a fallback value as defined in the Spec: 这篇关于在 CSS Flex/Grid 中使用带有 `justify-content`、`justify-items` 或 `justify-self` 的 `baseline` 值是否有意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
05-31 12:13