margin: auto is not only for horizontal centering.
CSS for JS Devs course
This can easily cause confusing bugs.
width work somewhat differently in CSS.
height looks "down" the tree
width looks "up" the tree.
Block elements stack on top of each other. Inline elements are placed side by side.
It's frustrating when a CSS declaration is technically valid (not crossed out in the browser's DevTools) but has no effect for some reason. Firefox DevTools can often tell you why and also how to potentially fix those issues! (Update: Chrome 108+ can too.)