logoalt Hacker News

seg6today at 12:26 AM4 repliesview on HN

Agreed, both outcomes are bugs and neither is intended. The idea is simply that, content the site author intended to be horizontally centered stays literally centered on my screen when browser UI changes the viewport.


Replies

Borealidtoday at 1:53 AM

This is a nonsensical goal.

If I drag a browser window to the right, making it cover the right-hand half of my monitor, it serves no useful purpose for "centered" content to migrate to the left edge of the window (the physical midpoint of the screen).

Centered means centered within the virtual viewport, not the physical screen.

JoshTripletttoday at 1:51 AM

That results in the first outcome: the content is centered on the screen, which puts it under the sidebar, while there's perfectly good space being ignored off to the right of it.

It's a cute trick, please don't use it, this is one of many reasons why. If I have a sidebar open, it's because that space is not yours to care about.

kqptoday at 1:55 AM

Think about users who don’t maximize the window, for whom centering to the screen, not viewport, would just be broken. It’s right to center to the viewport, and right that you’re able to turn that into centering to the screen by maximizing. The issue, I think, is that you don’t like that the sidebar changes the viewport, and really want a popup menu. I think your browser might duplicate sidebar functionality in configurable toolbar button popups, have you tried that? Failing that, I think the right solution to this problem might be a browser extension.

wat10000today at 12:34 AM

The author should not intend that, and if they do, my browser should do its best to put a stop to it.

show 1 reply