有很多说法是使用:
text-align:justify;
text-justify:inter-ideograph;
但我使用text-justify:inter-ideograph会出现报错,而我也没找到出错原因。
为实现两段对齐,我直接使用:
css:
.justify { text-align: justify; }
.justify > span { display: inline-block; padding-left: 100%; }
html:
<div class="justify">两端对齐<span></span></div><br/>
(以上代码借鉴于https://www.cnblogs.com/lzkwin/archive/2012/11/08/2761667.html)
注:若使用汉字可不用空格,使用英文需空格