Catching Up on CSS

position

Once positioned, use top, bottom, left, right to place elements. The default is static, which ignores those props. z-index controls stacking order. Set the parent to relative and absolutely position children you want to overlap.

Flexbox

display

Block/inline-block can set width/height and all margins/padding. Inline elements can only set horizontal margins/padding but support text-align. Inline elements usually live inside block-level elements.

Width/height units

Set only width + height: auto to maintain aspect ratio. With auto, width includes padding/border; width: 100% does not. Use min-width / max-width to cap sizes.

margin vs. padding

margin adds outer spacing; padding adds inner spacing.

div vs. span

div is block-level; span is inline. div introduces line breaks; span is great for inline styling.

white-space

::before / ::after

Pseudo-elements to inject content before/after an element.

overflow

Misc

Grid systems and multi-column layouts are on my “study later” list.