Skip to content

[css-align] Which behavior for block's "justify-self: center"? #1612

@tabatkins

Description

@tabatkins

There are two possible behaviors for justify-self:center on blocks in the presence of a float:

  1. Reduce the size of the alignment container by the size of the float's margin box, then center the block in the remaining space (this is the behavior of HTML's align attribute)
  2. Center the block ignoring the float, then shift it out of the way of the float if necessary. (This is the behavior of centering a BFC with auto margins.)

@fantasai and I are leaning toward option 1, simply because we already have a way to do option 2 in CSS, and both behaviors are useful in different circumstances. Also, since we're trying to explain the behavior of align using justify-self, the property should be able to duplicate this behavior.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions