text-align: -webkit-center vs text-align: center

后端 未结 2 1599
旧巷少年郎
旧巷少年郎 2021-02-05 08:28

Does anyone know why there is a difference between text-align: center and , text-align:-webkit-center ? For example if you have :

Titl

相关标签:
2条回答
  • 2021-02-05 09:10

    The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements, only their inline content.

    text-align: -moz-center;
    text-align: -webkit-center;
    
    0 讨论(0)
  • 2021-02-05 09:17

    From the Mozilla Developer Network:

    Both WebKit and Gecko support a prefixed version of left, center, and right, that applies not only to inline content but also to block elements. This is used to implement the legacy align attributes on table elements and <center>. Do not use these on production Web sites.

    — MDN's documentation on text-align.

    0 讨论(0)
提交回复
热议问题