need help CSS centering with absolute positioning

后端 未结 9 1222
庸人自扰
庸人自扰 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:14

    The text-align: center; property does what

    used to and it is vastly superior to it.

    Only thing is, it's a bit more complex to use. Once you get the hang of it, you'll wonder why you were having so much trouble before!

    You must use it in coordination with the properties of other elements on the page. That is the issue developers/designers have with CSS and newer HTML technologies. It gives us a powerful way to present our page elements but makes it much more complex and strict.

    Mike Robinson's answer certainly solves the problem you're having here and it's a great example. But...

    I don't think any one answer will show you how to use text-align properly for all cases you'll come across but try looking into how positioning in CSS works more in-depth.

提交回复
热议问题