Live data from Hacker News

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

seg6.space

31–40 of 172 posts

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

#31

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.

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

It's easy, you just need to hold your phone such that your eyes are pointed directly at the ads as they scroll up and down the screen. Thank you for consuming content.

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

#33
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…

I’ll accept that not everyone likes a portrait page on a landscape screen, that’s a matter of taste. But if you’re going to invoke Usage and Abusage, grammar, punctuation, and "basic decency", it would help to identify an actual error. And perhaps write "it’s" correctly while doing so. I’m also unclear what moral failing you think an A4 aspect ratio represents.

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

#34
post #17

Earlier quoted context omitted.

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

Actually, they do, sort of. At least, if you use GLSL shaders. I remember some demo project using it in a way that made it appear that the website "sees" another window with the same website, which blew my mind when I saw it first. Cannot recall the name or anything else to locate it.

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

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

#35
post #15

Earlier quoted context omitted.

The point of centering an element horizontally is to make sure that the content you’re viewing is directly in front of you. Browsers with a sidebar shift the content to the right, assuming the sidebar is on the left, which I’ve come to dislike! Others have expressed the same preference, hence this little snippet on my website.

As a rule, you should not add functionality to a website to compensate for browser misfeatures. People who want the browser to work differently can get a different browser: that's why we call them "user agents". Making the web all complicated like this mainly serves to make it harder for people to use alternative browsers, or for browsers to change their misfeatures without breaking compatibility.

Fair enough, that criticism resonates. I've decided to keep this behaviour only in the extension and have reverted it from the blog. Thanks!

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

#36
post #34
post #17

Earlier quoted context omitted.

Actually, they do, sort of. At least, if you use GLSL shaders. I remember some demo project using it in a way that made it appear that the website "sees" another window with the same website, which blew my mind when I saw it first. Cannot recall the name or anything else to locate it.

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

Yep, that's right.

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

#37

Earlier quoted context omitted.

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

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.

position: hyperfixed;

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

#39
post #24

Earlier quoted context omitted.

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.

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

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

#40
post #15
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.

The point of centering an element horizontally is to make sure that the content you’re viewing is directly in front of you. Browsers with a sidebar shift the content to the right, assuming the sidebar is on the left, which I’ve come to dislike! Others have expressed the same preference, hence this little snippet on my website.

I don't usually use browsers sidebars, but when I do I mentally compensate for it. The viewport is in fact the part of the web page I expect to be the full width, and what things should be centered on.

The same way the vertical centering counts the viewport height only, not the url bar and the tab bar.

Post reply on HN