浮到包装纸底部

问题描述 投票:0回答:1

我们使用

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>

css css-float
1个回答
0
投票
<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>

© www.soinside.com 2019 - 2024. All rights reserved.