A partial archive of discourse.wicg.io as of Saturday February 24, 2024.

Vertical align of element

117
2018-09-04

I suggest develop an vertical align for block or inline-block elements for centered between top and bottom block or inline-block neighbour. Or maybe exist another solution? (exept position and margin).

sbaechler
2018-09-06

The other solution would be Flexbox. align-items: center centers all child items on the secondary (vertical by default) axis.

A Hack for centering the content of inline elements is using the <button> tag with vertical-align: middle.

SebastianZ
2018-09-07

That’s already specified in the CSS Box Alignment Module Level 3. The align-items property mentioned by @sbaechler already applies to all elements, also the related justify-* properties and the other align-* properties are defined to apply to block containers.

The browsers just didn’t implement those properties for block containers yet. Though, as @sbaechler already said, for now you can use them on flex and grid containers.

117
2018-09-10

Thank you for reply.

117
2018-09-10

Thank you too