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

9 points by seg6


ubernostrum

After opening and closing the Safari sidebar (Safari on iPadOS), the "centered" content div of this site does not stay centered.

Also, the post claims that centering used to be done by:

.thing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

when my (admittedly quite old) memory is that the traditional approach was to set a width on the div in some reasonably scalable unit and then both margin-left and margin-right to auto.