Can overflow text be centered?

后端 未结 8 944
傲寒
傲寒 2020-12-23 14:14

When I specify text-align:center for an element with a width that is greater than the width of the text, the text is centered within the content box of the elem

8条回答
  •  爱一瞬间的悲伤
    2020-12-23 15:13

    Strange requirement. I would expand the boxes to the texts size.

    One possible solution might involve a negative text-indent: text-indent: -50px;, but that won't work for smaller texts (first DIV in your example). No better idea here right now.

提交回复
热议问题