Live data from Hacker News

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

seg6.space

161–170 of 172 posts

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

#161

Earlier quoted context omitted.

> Firefox likes to draw the websites underneat the scrollbar. This was a choice that they actively made. It's not hard by default, they just chose to do something stupid because they think it looks pretty.

I genuinely like the trend towards invisible scrollbars that only become larger if you want to drag them with the mouse, and that don't affect layout. This seems like a win for having more screen real-estate, both for the whole window and for smaller scrollable elements where the scrollbar might otherwise be a noticeable fraction of the element's size.

You can also get layout glitches if you screw up your math where the scroll bar disappears and reappears in a tight loop. This is a dodge for that. The viewport doesn’t resize when the content gets longer and you either run never into > 1024 || > 1024, or you hit it on first paint and it gets solved at design time.

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

#162

Earlier quoted context omitted.

Are these broken popup menus and combo box dropdowns with us in the room right now? Yes, some things in some complex applications can break, but there are solutions and, practically, these particular things you listed simply aren't among those that break.

GNOME Files (nautilus) made the file property dialog a modal because they really want it to be centered relative to the file browser window and wayland didn't let them position or obtain coordinates. The result is that you can't open open two file property dialogs at once (to compare sizes or dates or any other meta data, it's a common thing one might want to do). Hopefully you'd agree that Wayland should allow apps…

With Dolphin file manager on Wayland this works for me as expected, a new window opens in the centre of the file browser window, no matter the size or position of the window. I didn't do any actual testing but I wonder what the difference is.

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

#163

Earlier quoted context omitted.

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

I disagree that's what people mean by "Centering a div" and the hilariously repetitive corpus of programmerhumor jokes on the matter seem to disagree too. And in either case, I don't think the article fully agrees either, since the thesis of it relates to a strictly horizontal element. If the article doesn't intend to disagree, then it was just a framing device they used in the writing that has some distractions rega…

Oh really? I always assumed as I never thought horizontally centring was ever a huge problem. Vertical was the actual hard thing for a long time (which is something table cells could easily do since the beginning).

You caught me in that I didn't read the full article, but I read enough to see that it has this CSS which centres on both axes:

    body {
      display: grid;
      min-height: 100dvh;
      place-items: center;
    }

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

#164

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.

I've actually kind of wanted something like that.

Sometimes there is no size setting that will get the text lines on a page to fit horizontally without making the text too small to read. Making it large enough to read means lots of left and right scrolling which is annoying.

A mode where moving the phone sideways scrolls the text at a matching rate so that the experience is similar to reading a page with a magnifying glass might be handy.

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

#165
post #164

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.

I've actually kind of wanted something like that. Sometimes there is no size setting that will get the text lines on a page to fit horizontally without making the text too small to read. Making it large enough to read means lots of left and right scrolling which is annoying. A mode where moving the phone sideways scrolls the text at a matching rate so that the experience is similar to reading a page with a magnifying…

Most people would rather lines to be broken up and wrapped around than to have to walk around the room to read. Do you often find yourself reading photographs of stone tables or something?

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

#166

Earlier quoted context omitted.

Why? The window and its position shouldn't matter to the app. My tiling window manager doesn't care what your snowflake app thinks it wants, and I don't either.

You are literally replying to a thread that has an example of a game where the position of the window matters.

It was a cute stunt, and it's fine for it to stop working so that sites stop misbehaving.

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

#167
post #164

Earlier quoted context omitted.

I've actually kind of wanted something like that. Sometimes there is no size setting that will get the text lines on a page to fit horizontally without making the text too small to read. Making it large enough to read means lots of left and right scrolling which is annoying. A mode where moving the phone sideways scrolls the text at a matching rate so that the experience is similar to reading a page with a magnifying…

Most people would rather lines to be broken up and wrapped around than to have to walk around the room to read. Do you often find yourself reading photographs of stone tables or something?

Why would you have to walk? You would be moving the phone back and forth by less than the width of a page.

Wrapping is fine on some material, but when there are tables it can be very annoying.

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

#168

Earlier quoted context omitted.

Are these broken popup menus and combo box dropdowns with us in the room right now? Yes, some things in some complex applications can break, but there are solutions and, practically, these particular things you listed simply aren't among those that break.

GNOME Files (nautilus) made the file property dialog a modal because they really want it to be centered relative to the file browser window and wayland didn't let them position or obtain coordinates. The result is that you can't open open two file property dialogs at once (to compare sizes or dates or any other meta data, it's a common thing one might want to do). Hopefully you'd agree that Wayland should allow apps…

Making the pop-ups model has nothing to do with windows not knowing their position on screen.

It's a design choice.

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

#169
post #144
post #143

Earlier quoted context omitted.

Do you want them to add Subway Surfers in the sidebars? What would they display if there's nothing to display? This is such a weird criticism, do you think you want the text to use the full width? It would just be hard to read because of long lines, shorter lines are more comfortable It's not like unused space results in some kind of waste, this is not paper, blank space is okay

> It would just be hard to read because of long lines, shorter lines are more comfortable That's a pretty subjective view, and one at odds with literally every other website I can think of

That's actually pretty objective, long lines force you to move your neck and your eyes more which is more straining. I rarely read HN comments on my laptop because of the unreasonable line width, it feels much more comfortable to read on my phone

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

#170

Earlier quoted context omitted.

If only UX worried more about user preferences instead of coming up with these dogmatic rules. We can already resize the browser window if we want shorter lines.

I'm sure there's something going back to newspapers on this (though they would of course, fill multiple columns), but I can't help but suspect a lot of these UX studies are just predetermined to justify things like extra space on the margins for ads, "related content" distractions, and such things.

Personally, I always found those newspaper columns hard to read, you constantly have to jump back and forth and they break them into so many pieces you have to actively search along the page to see where the damn thing continues.
Post reply on HN