Centering a div
It will center according to it's available width and height, so make sure if you want it to center on a whole page that you're giving it 100vh and 100vw. I hear some people hating on flex, but flex and grid are my go to ways to create layouts. They create predictable topologies, and don't do something random based on whatever that HTML tag's default behaviour is. I highly encourage you to embrace creating more dynamic layouts with flex as well, and stop worrying over little things.