Live data from Hacker News

We finally learned to center a div, then browsers added sidebars

seg6.space

51–60 of 172 posts

Re: We finally learned to center a div, then browsers added sidebars

#51
post #39

Earlier quoted context omitted.

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

I'm fairly certain you just replied to the author

I hope the author gets the point then.

Re: We finally learned to center a div, then browsers added sidebars

#52
post #24

The net result of what this site is doing seems to result in one of two effects when I open the sidebar, randomly: 1) the sidebar covers the content, while the content has blank space to the right, or 2) the content moves off the right edge of the screen, leaving a large blank space to its left. Both of these are wrong. If I have a sidebar open, the site is now narrower , stop trying to be clever. My immediate reacti…

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.

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.

Re: We finally learned to center a div, then browsers added sidebars

#53

Earlier quoted context omitted.

Wait, I have to hold my phone how in order to see the div? ಠ_ಠ

I assume you have to be facing the server...

I mean, this could have applications, if you need to be facing a certain direction to read the content.

While the Silicon Valley is merely a figurative Mecca for all things tech, Apple could require people to be facing Cupertino if you want to watch a WWDC stream :D

Re: We finally learned to center a div, then browsers added sidebars

#54

You’ve effectively created a slide over sidebar. It’s an interesting hack to get there but IMO “should” properly be the domain of the browser.

See, I'm keeping my siidebar open most of the time, so I WANT it to cover the content that would otherwise be visible - said no one ever.

But yay, it's centered relative to the window now! God forbid the user tiles their windows, because it breaks the aesthetic the website author intended.

Re: We finally learned to center a div, then browsers added sidebars

#55
post #36
post #34

Earlier quoted context omitted.

My guess is that you’re remembering this demo: https://xcancel.com/_nonfigurativ_/status/172732259457002734...

Yep, that's right.

The ability from this demo is Chromium-specific, needs extra permissions and has nothing to do with GLSL: https://developer.mozilla.org/en-US/docs/Web/API/Window_Mana...

Re: We finally learned to center a div, then browsers added sidebars

#56
post #26

I'm 55 years old. My eyes are not what they used to be and neither are my glasses. I also own a copy of "Usage and Abusage" but I'll pass on that. Click on story link. My laptop renders a page - OK its black text on a white background (thank you but I doubt its a deliberate boon) ... ... why on earth is the offering a "page" ie emulating a printed page? In portrait! I'll accept that most people are not fixated about…

Longer lines of text are harder to read. There's a reason newspapers, books, articles, etc are all vertical and often have a similar amount of words per line. It's easier to follow, scan, and find your place.

Some more on this below:

Optimal Line Length in Reading — A Literature Review (https://journals.uc.edu/index.php/vl/article/view/5765)

Practical Typography — Line Length (https://practicaltypography.com/line-length.html)

Re: We finally learned to center a div, then browsers added sidebars

#57
Am I the only person that loathes sidebars in browsers? Maybe it's because I've been using a browser since 1996, but my brain is deeply set in the idea that the space below the chrome 110% belongs to user space.

I've tried a few browsers with vertical tabs, and my brain keeps seeing them as part of the page itself. It's a very distracting and uncomfortable experience.

Re: We finally learned to center a div, then browsers added sidebars

#58
post #39

Earlier quoted context omitted.

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

I'm fairly certain you just replied to the author

The author referred to themselves in the third person, so I did the same.

Re: We finally learned to center a div, then browsers added sidebars

#59
post #41

Earlier quoted context omitted.

Wait until they realize that on mobile they can use accelerometer data to keep the element in the same position in space across translations of the device.

So the content falls down at 10 m/s^2 unless you're falling alongside it.

But the problem is, you can never quite catch up to it without a rocket.

Re: We finally learned to center a div, then browsers added sidebars

#60
post #4

This might be some kind of a weird requirement for a piece of art, but I would literally never expect a website to center a div according to the browser window instead of the viewport. It just looks wrong and feels wrong.

Same. Thank heavens the website doesn't know the position of the browser's window in respect to the screen it's on.

There's several web APIs for browser window positioning, like screenX/Y[0] (which is what OP uses), which allows for those classic pop-up based browser games from over a decade ago, like Browser Ball.[1]

[0]: demo: https://mdn.github.io/dom-examples/screenleft-screentop/

[1]: https://romanbaiocco.github.io/browser-ball-reloaded/

Post reply on HN