@dorian-edwards
Posted
If a div has a width < 100% or < 100vw you can use "margin: 0 auto" to center it as well. the 0 sets the margin along the y axis, top and bottom, to 0, and auto will put enough margin on either side of your div along the x axis to set it in the middle of the screen.
The div element is block level by default so this works, if you override the display of your div and make it inline or inline-block, this will no longer work.