如何居中对齐文本?
目前,justify 不会将最后一行居中。
最佳答案
您可以使用 text-align-last
属性(property)
.center-justified {
text-align: justify;
text-align-last: center;
}
这是一个兼容性表:https://developer.mozilla.org/en-US/docs/Web/CSS/text-align-last#Browser_compatibility .
适用于所有浏览器除了 Safari(Mac 和 iOS),包括 Internet Explorer。
同样在 Internet Explorer 中,仅适用于 text-align: justify
(没有其他值 text-align
)和 start
和 end
不支持。
关于html - 如何居中对齐 CSS 中的最后一行文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4704896/