Live data from Hacker News

Hardest problem in computer science: centering things

tonsky.me

471–473 of 473 posts

Re: Hardest problem in computer science: centering things

#471
I mean this just proves yet again that CSS is a convoluted mess not suited to use as a styling language. Its only merits are that it has been around for a long time and all browser support it.

I'd much rather use a proper grid layout with subgrids and local/global co-ords same as game dev and in fact I've always wondered if I can just write a web lib that uses webgl to render the page instead. Problem is DOM engines are just too efficient compared to recreating it all myself in js/webgl.

Re: Hardest problem in computer science: centering things

#472
I got fed up with a font being off-centre on a design I was trying to develop and I ended up using this descent-override CSS property on the @font-face block which works rather nicely: https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/... That way you can control the vertical position of the whole font.

Looks like it's not supported in Safari yet.

There's also ascent-override.

Post reply on HN