Hey All, I put up a fixed header (doesn't scroll with page). position:fixed, sticks it to the top left. I want it centered. Anyone have any idea?
Uh.. as far as I know horizontal auto margins only work on static positioned block level elements that aren't intristic (image, table). One solution would be to set left to 50% and a margin-left equal to half of the element's width, if it has a fixed width. Demo below. http://www.soulscratch.com/playground/css/centering-elements.html
Wouldn't you use the following: div#header { padding: 0; margin: auto; text-align: center; } Code (markup): N.B. the text align is for ie.