need help CSS centering with absolute positioning

后端 未结 9 1199
庸人自扰
庸人自扰 2021-02-14 07:41

I\'ve never been totally satisfied with my various solutions to centering content in a web page. the

tag has been deprecated back in the middle of th
9条回答
  •  走了就别回头了
    2021-02-14 08:07

    I nice way to center stuff is to use the "margin:auto" css tag. This works in FF and Safari. Just give a div some width and a margin auto, and if the parent is 100% width, then this div will center align itself.

    For this to work in IE, you have to use the text-align:center attribute on the parent and then text-align left on the actual centred div.

    AFAIK, there is no way to change the absolute co-ordinates from 0,0 to some other arbit point. Relative is the way to go.

提交回复
热议问题