How to center-justify the last line of text in CSS?

后端 未结 10 1681
余生分开走
余生分开走 2020-12-02 08:23

How can I center-justify text?

Currently, justify does not center the last line.

10条回答
  •  时光取名叫无心
    2020-12-02 09:00

    There doesn't appear to be a way. You can fake it by using justify and then wrapping the last line of text in a span and setting just that to text align center. It works ok for small blocks of text but is not a useful approach to large quantities of text or dynamic text.

    I suggest finding somebody at Adobe who's involved in their W3C work and nagging them to bring up right/left/center justification in their next meeting. If anyone's gonna be able to push for basic typography features in CSS it'd be Adobe.

提交回复
热议问题