我们使用
float
将链接移至右侧。但它与第一行对齐。如果我们需要让它对齐到最后一行,该怎么办?
.wrapper {
text-overflow: ellipsis;
overflow: hidden;
display: -webkit-box;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.button {
float: right;
}
<div>
<p class="wrapper">
<a class="button" href="#">More</a>
The spec for it is currently an Editor’s Draft, so that means nothing
here is set in stone because it’s a work in progress. That said, it’s
defined as a shorthand for max-lines and block-overflow, the former of
which is noted as at risk of being dropped in the Candidate
Recommendation.
</p>
</div>
<div>
它的规范目前是编辑草案,所以这没有任何意义
这是一成不变的,因为它是一项正在进行的工作。也就是说,它是
定义为 max-lines 和 block-overflow 的简写,前者
被指出有可能在候选中被删除的风险
推荐。
更多的
.wrapper {
text-overflow: ellipsis;
overflow: hidden;
display: box;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
position: relative;
}
.wrapper div{
float: right;
position: absolute;
bottom: 0;
right: 0;
}
<div>
<div class="wrapper">
The spec for it is currently an Editor’s Draft, so that means nothing
here is set in stone because it’s a work in progress. That said, it’s
defined as a shorthand for max-lines and block-overflow, the former of
which is noted as at risk of being dropped in the Candidate
Recommendation.
<div class="button"><a href="#">More</a></div>
</div>
</div>