Getting a close button to hang off of a dialog

Getting a close button to hang off of a dialog.

Darin Senneff explores how modern CSS Anchor Positioning can simplify the design of modals with overhanging close buttons. The technique avoids overflow hacks, wrapper divs, and ARIA pitfalls by anchoring the button directly to the dialog, keeping it accessible and visually clean. A minor scrollbar overlap issue can be fixed with a transparent border.

darins.page/articles/close-button-hang-dialog