0

我想在超过两行的文本末尾对齐 after 元素。

这适用于 Safari 和 Chrome,但不适用于 Firefox。

有人对我如何解决这个问题有任何建议吗?

蓝线应该紧跟在标题之后,例如“标题_”。

p.subtitle {
  color: #F94922;
  font-size: 30px;
  display: inline;
  font-weight: 300;
  position: relative;
  line-height: 1.1;
}

p.subtitle::after {
  content: "";
  background: #002C5A;
  border-radius: 10px;
  display: block;
  right: -66px;
  bottom: 2px;
  width: 50px;
  height: 6px;
  position: absolute;
}
<div class="subtitlewrap">
  <p class="subtitle">This is a long <br />headline</p>
</div>

4

0 回答 0