/* 这种写法最后一行不会两端对齐,意味着只有一行的时候不会两端对齐 */
p {
width: 300px;
word-wrap: break-word !important;
text-align: justify;
}
/* 如果是需要单行也两端对齐加上下面的代码 */
p:after {
display: inline-block;
content: '';
padding-left: 100%;
}
**
微信的写法是在 p 标签中写一个内容为空的 span 标签,我使用了伪类替代,效果一致。
**