When in doubt, try positioning

Just that. I have had enough experiences where setting position was my last-ditch throw the kitchen sink at it effort, but turned out to be the key, that it’s hard to believe I haven’t started trying it first.

A non-exhaustive list: I’ve covered how positioning affects z-order and an experience where moving position:relative a bit higher in the ancestral chain fixed a quirky layout. Position is often necessary for size and margin settings to behave as desired, and in particular is a key part of divs that preserve their aspect ratio. It’s everywhere.

Leave a Reply

Your email address will not be published. Required fields are marked *