如何保留换行符,但有文本对齐:justify? [英] How to preserve line breaks but have text-align:justify?

查看:87
本文介绍了如何保留换行符,但有文本对齐:justify?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要换行符的文本,我不想在每行之后添加< br /> ,所以我使用空格:预先包装。我想要 text-align:justify 。但是他们似乎并没有共同努力。

I have text which has line breaks as needed and I don't want to have to add a <br/> after each line so I use white-space: pre-wrap. I want to have text-align:justify as well. But they don't seem to work together.

有没有办法解决这个问题?

Is there a way to overcome that?

推荐答案

而且您还需要 text-align-last ,因为 text-align 't cut it。

What you want is white-space:pre-line, not pre-wrap.



这篇关于如何保留换行符,但有文本对齐:justify?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆