Skip to content
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

text-align: inherit for th is centered in Safari, align to the start of the block in Chrome and Firefox #7978

Open
karlcow opened this issue Jun 2, 2022 · 1 comment

Comments

@karlcow
Copy link
Member

karlcow commented Jun 2, 2022

https://html.spec.whatwg.org/multipage/rendering.html#rendering

User agents are expected to have a rule in their user agent style sheet that matches th elements that have a parent node whose computed value for the 'text-align' property is its initial value, whose declaration block consists of just a single declaration that sets the 'text-align' property to the value 'center'.

From top to bottom: Safari, Chrome and Firefox (latest versions)

Minimal test case

data:text/html,<!doctype%20html><table><tr><th%20style="text-align:inherit">START</th></tr><tr><td>AAAAAAAAAAAAAA</td></tr></table>

browsers rendering

BootStrap expected the case of having things aligned on the left, hence they used text-align: -webkit-match-parent to force the alignment.
twbs/bootstrap#30321 (comment)

@annevk
Copy link
Member

annevk commented Jun 2, 2022

cc @whatwg/css

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

No branches or pull requests

2 participants