How do I horizontally center an element of variable width that needs to be on top of the other elements?
The accepted answer here Easy way to center variable width divs in CSS is good for centering variable width, but it pushes everything else down:
Normally I do:
position:absolute;
width:200px;
left:50%;
margin-left:-100px;
But this requires a set width.
(It's for a message box that pops up and needs to be centered on top of the other text.)