CSS中心多行文字,但最上面的行最短?

时间:2013-07-05 22:08:04

标签: html css text alignment

我有一些类似的html,css:

<div style="width: 40em; text-align: center;">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy tex
</div>

的呈现方式与this类似,但我希望最短的一行显示在最前面,例如this。 我无法弄清楚如何做到这一点,任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:1)

文本由Web浏览器自动显示,直到块宽结束。如果你想要不同的东西,你必须休息一下。

<div style="width: 40em; text-align: center;">
    Lorem Ipsum is simply dummy text<br>
    of the printing and typesetting industry. Lorem Ipsum has been the 
    industry's standard dummy tex
</div>