如何在 CSS 中将文本居中,以便输出文本的样式从较小的行到较大的行并居中?示例输出(没有破折号):
---------- 你有吗
------ 一个想法和需要
为了追求它而提供帮助?
谢谢!
最佳答案
像这样?
.text-center {
text-align: center;
}
/* This will break the text after each span */
span::before {content: '\A'; white-space: pre;}
<div class="text-center">
<span>DO YOU HAVE</span><span>AN IDEA AND NEED</span><span>HELP IN ORDER TO PURSUE IT?</span>
</div>
关于css - 使用 CSS 从小到大的中心线长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57976565/