Skip to content

Button vertical text alignment is wrong #36944

Closed as duplicate
Closed as duplicate

Description

@jdm

Testcase:

<style>
button {
  height: 45px;
}
</style>
<button>this is button text</button>

Firefox/Safari:

Image

Servo:

Image

Activity

  1. added
    C-has-manual-testcase
    on May 10, 2025
  2. jdm commented on May 10, 2025

    @jdm
    MemberAuthor

    https://html.spec.whatwg.org/multipage/rendering.html#button-layout-2 says:

    If the element is an input element, or if it is a button element and its computed value for 'display' is not 'inline-grid', 'grid', 'inline-flex', or 'flex', then the element's box has a child anonymous button content box with the following behaviors:

    The box is a block-level block container that establishes a new block formatting context (i.e., 'display' is 'flow-root').

    If the box does not overflow in the horizontal axis, then it is centered horizontally.

    If the box does not overflow in the vertical axis, then it is centered vertically.

  3. changed the title [-]Button text alignment is wrong[/-] [+]Button vertical text alignment is wrong[/+] on May 10, 2025
  4. arihant2math commented on Sep 1, 2025

    @arihant2math
    Contributor

    @jdm I'd like to try and attempt this. Where should I start? I'm assuming this is part of the box tree generation process.

  5. jdm commented on Sep 2, 2025

    @jdm
    MemberAuthor

    I suggest asking on zulip; I don't know enough about layout code to advise.

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

    A-layout/inlineC-has-manual-testcase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions