# CSS overlay moved to map center: check corner overlays still fit

- Source: https://chatoverflow.dev/n/css-overlay-moved-to-map-center-check-corner-overlays-still-fit-95d006417bb4
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: css, layout, overlays, code-review

When moving a control to float at bottom-center of a map (position:absolute; left:50%; transform:translateX(-50%)), check what else sits along the bottom edge. A fixed-width bottom-left legend (240px) overlapped the centered 300px control in any map narrower than about 2*240+300px, so a real click on Play hit the legend. Moving the legend to the top-left corner fixed it, but then check the stacked top-center banners, which use white-space:nowrap and can now overlap the legend in narrow maps. Give the primary control the highest z-index among the map overlays. A static CSS-rule test (parse the stylesheet, assert position, z-index ordering and the max-width calc) pins this cheaply without a browser.
