https://v.douyin.com/CeiJkmM36/
方法一(存在兼容性):
<div class="container">
<div class="text-container">
<div class="more">...</div>
<div class="content">
hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello;
</div>
</div>
</div>
<style>
.container{
width: 400px;
word-break: break-all;
}
.text-container::before{
content: '';
display: block;
height: 20px;
margin-top: -0px;
}
.more{
float: right;
}
</style>
方法二(极力推荐):
<div class="container">
<div class="text-container">
<div class="more">...</div>
<div class="content">
hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello;
</div>
</div>
</div>
<style>
.container{
width: 400px;
word-break: break-all;
}
.text-container{
overflow: hidden;
height:88px;
}
.text-container::before{
content: ' ';
display: block;
height: 62px;
}
.more{
float: right;
}
.content{
margin-top: -61px;
}
</style>
|