Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't think you have to have a "pixel-perfect" rendering system to support centering things correctly?


If you don't, you'll be off by 1px?


So, I would use the term "pixel-perfect" to mean that the person making it can target some specific layout, choosing all aspects such as the sizes and fonts and exact colors and such. However, even without that, you can still say "I want this to be monospaced red on a blue background and larger than usual" and all of those properties can vary but hopefully something should happen that preserves at least some of that intent? The properties of vertically centering something inside of a table cell to me are not part of a pixel-perfect layout system, and yet I feel like my user agent is doing a pretty poor job if it doesn't have at least some sane strategy for this, and to the extent to which there are multiple different good ways to do it I hate that it seems to default to "if I can't select a good way I'll just use a bad way" in its zeal to refuse to expose multiple definitions of "centered" to the web developer (and again: I don't think being able to say "try to center this in a way useful for numbers" is part of "pixel perfect").


You're right. The browser should just expose this capability and get it right.

Recently I've learned that even the parts of OpenGL which are fully specified give wrong results on ubiquitous hardware+driver combos at the pixel level. The commonly proposed solution is "instead of using the transforms and blending exposed by OpenGL, do it correctly yourself in a shader." Gosh.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: