From what I know, the justify-items
and justify-self
CSS properties are used in CSS Grid layouts, and don't have any effect in Flexbox layouts (unlike the similarly-named but different justify-content
property). Indeed, MDN says in the docs for both justify-items
and justify-self
that
In flexbox layouts, this property is ignored
and has a whole section with the heading There is no justify-self in Flexbox on the Box Alignment in Flexbox page.
And yet, mysteriously, the justify-items
docs list these two possible values:
justify-items: flex-start; /* Pack flex items from the start */
justify-items: flex-end; /* Pack flex items from the end */
These values also show up as autocomplete suggestions in the developer tools of browsers like Chrome and Firefox if you start setting a justify-items
or justify-self
property.
Why do these values exist if justify-items
and justify-self
are ignored in Flexbox layouts? Are they specced? What do they do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…