Live data from Hacker News

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

seg6.space

1–10 of 172 posts

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

#5

margin:0 auto is the (probably incorrect) incantation I have always reached for

That's fine but it only centres horizontally. Usually when people talk about "the div centring problem" they mean x and y, dead centre (as this article is).

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

#7
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.

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

#9
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.

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.

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

#10
I had no idea what this was talking about at first because I had JS blocked, so nothing special seemed to happen when I opened the bookmarks panel. This looks absolutely goofy. I don't know why you'd want the content potentially getting covered by unrelated UI elements.
Post reply on HN