我正在尝试进行线钳位,那就是 example它是什么。
因此,在我的应用程序中,生成的不是空格“”,而是  
。
问题是,当我尝试这样做时,第一行显示得很丑,因为在该行中短语被分成两个单词。在我的主元素中,我对  
消失无能为力。
那么有没有什么 CSS 解决方案可以让它看起来不错呢?
这是codepen .
HTML
<div class="container-fluid">
<div class="col-md-4">
<div class="jumbotron">
<div class="row description">
<p>
Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words Some words
</p>
</div>
</div>
</div>
</div>
CSS
$font-size: 14px;
$line-height: 1.3;
$lines-to-show: 8;
.description {
display: block;
display: -webkit-box;
height: $font-size*$line-height*$lines-to-show;
margin: 0 auto;
font-size: $font-size;
line-height: $line-height;
-webkit-line-clamp: $lines-to-show;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.jumbotron p {
font-size: 14px;
margin-bottom: 0;
}
.container-fluid {
margin: 30px 60px;
.jumbotron {
background-color: #00FFFF;
padding: 0;
}
}
最佳答案
我建议你使用的一件事是:
text-align: justify;
这将拉伸(stretch)文本以达到容器的全宽。
关于html - 如何使用   字符进行换行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33275515/