8000 [css21][css-inline] height of inline box with line-height not normal · Issue #1797 · w3c/csswg-drafts · GitHub
Skip to content

[css21][css-inline] height of inline box with line-height not normal #1797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
frivoal opened this issue Sep 11, 2017 · 1 comment
Closed

Comments

@frivoal
Copy link
Collaborator

frivoal commented Sep 11, 2017

This is part of the #1796 series. Read that issue for context

Test source
Ref source
Live test
Live ref

As demonstrated by this test, all browsers (Edge, FF, Safari, Chrome) agree that when you set the line-height property to a value other than normal, you get exactly the height you asked for, even when there are differently sized fallback fonts involved. In other words, nobody does the black behavior in this diagram.

Whether browsers do the red behavior, the blue one, or something else depends on how the baseline is positioned, and that will be dealt with in #1801

@frivoal
Copy link
Collaborator Author

frivoal commented Sep 12, 2017

This means this note from CSS21 is misleading:

When there is only one value of 'line-height' for all inline boxes in a block container box and they are all in the same font (and there are no replaced elements, inline-block elements, etc.), the above will ensure that baselines of successive lines are exactly 'line-height' apart. This is important when columns of text in different fonts have to be aligned, for example in a table.

This is true when line-height is some value other than normal even if glyphs from fonts other than the primary available font are used.

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

No branches or pull requests

1 participant