Skip to content

CSS justify-items and justify-self without flexbox or grid #1037

Closed

Description

@o-t-w

Description

justify-self should work for block-level boxes and justify-items should work for block containers.

This is implemented in Chromium-based browsers since version 130 (it was not mentioned in any release notes but is mentioned here). In Firefox and Safari, justify-items can only be used in conjunction with display: grid and justify-self can only be used for absolutely positioned boxes or grid items.

Several updates to alignment have been implemented across all browsers over the last few years:

  • The self-alignment properties align-self and justify-self work for absolutely positioned elements.
  • align-content works without the need for flexbox or grid.

This finishes the work of updating CSS alignment.

Specification

https://www.w3.org/TR/css-align-3

web-feature

No response

Test Links

https://wpt.fyi/results/css/css-align/blocks?q=justify-self%7Cjustify-items

Additional Signals

Mozilla standards position

Activity

  1. added
    focus-area-proposal
    on Sep 6, 2025
  2. github-actions commented on Sep 6, 2025

    @github-actions

    This comment was automatically generated based on the information you provided. Please don't edit it.

    No web features (from the web-features project) were found in your proposal. If your proposal doesn't correspond to a web feature, that is fine.
    Otherwise, please update your initial comment to include web-features: <feature-id>.
    To find feature IDs, use the web-features explorer.

  3. changed the title [-]CSS justify-items and justify-self[/-] [+]CSS `justify-items` and `justify-self`[/+] on Sep 6, 2025
  4. changed the title [-]CSS `justify-items` and `justify-self`[/-] [+]CSS `justify-items` and `justify-self` without flexbox or grid[/+] on Sep 6, 2025
  5. Loirooriol commented on Sep 6, 2025

    @Loirooriol

    For what it's worth, this works in Servo too, and was quite straightforward to implement (servo/servo#36595).

  6. jgraham commented on Sep 19, 2025

    @jgraham
    Contributor

    @Loirooriol do you happen to have a link to the right set of wpt tests to cover this proposal?

  7. Loirooriol commented on Sep 19, 2025

    @Loirooriol
  8. fantasai commented on Dec 2, 2025

    @fantasai

    Implementing justify-self on block-level boxes definitely makes sense. I'm a little concerned about justify-items, however, because if it is interpreted strictly it would violate the block-box transparency principle. ("Inserting an unstyled block in a block formatting context (as sibling, parent, child or intermediary), or an unstyled inline in an inline formatting context, should have no effect on rendering.")

    @Loirooriol How did you address this issue in Servo? We probably need to open a CSSWG issue to clarify the spec one way or another.

  9. Loirooriol commented on Dec 2, 2025

    @Loirooriol

    Yes, I guess the principle is violated. But that already happens with percentage resolution, adding a parent with height: auto can make percentages indefinite.

    Basically I just implemented what CSS Align says, and what Blink had shipped beforehand, modulo some issues that I reported (e.g. the resolution from w3c/csswg-drafts#11462 is in my TODO list)

  10. wpt-interop commented on Feb 12, 2026

    @wpt-interop
    Collaborator

    Thank you for proposing CSS justify-items and justify-self without flexbox or grid for Interop 2026.

    We want to let you know it was not selected to be part of Interop this year.

    On behalf of the entire Interop team, thank you for submitting it for consideration. We got many more proposals than we could include in this year's project, necessitating some difficult choices. Please note this should not be taken as a comment on the technology as a whole, or our willingness to consider it for Interop in the future. We appreciate the work you put into your proposal, and would welcome your participation in future rounds of Interop.

    Posted on behalf of the Interop team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    focus-area-proposal

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions