The spec does actually dictate that these are valid justify-items
and justify-self
values. It lists the legal values of justify-items
as:
normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ]
and defines <self-position>
as:
<self-position> = center | start | end | self-start | self-end |
flex-start | flex-end
I'm not sure, but I speculate that these possible values got yanked in as possible values for justify-self
and justify-items
without much consideration simply by virtue of being part of the <self-position>
category in the spec.
Regardless, the flex-start
spec says:
flex-start
Only used in flex layout. [CSS-FLEXBOX-1] Aligns the alignment subject to be flush with the edge of the alignment container corresponding to the flex container’s main-start or cross-start side, as appropriate.
When used outside of a flex formatting context, this value behaves as start. That is, on boxes that are not flex items (or pretending to be flex items, such as when determining the static position of an absolutely-positioned box that is a child of a flex container), this value behaves as start when used in the self-alignment properties, and on boxes that are not flex containers, this value behaves as start when used in the content-distribution properties.
(There's analogous wording for flex-end
.)
If we're talking about the justify-items
or justify-self
properties, then, if they're not being ignored, we are guaranteed to not be in a flex formatting context, and thus it will always be the case that:
this value behaves as start.
We can see this in action in a simple Grid layout:
#grid {
display: grid;
}
#item1 {
justify-self: flex-start;
}
#item2 {
justify-self: flex-end;
}
<div id="grid">
<div id="item1">flex-start</div>
<div id="item2">flex-end</div>
</div>
Of course, there's no good reason to use these over the less-confusing start
and end
values, so don't. But that's what they do, and why browsers support them.
MDN's documentation of what the values mean, on the other hand, is, at the time of writing, rather confusing and self-contradictory. I'll fix it in a moment, and hopefully by the time that you read this, it'll be clearer.