绝对文本将在不同大小的图像的不同位置从底部开始

qoefvg9y  于 2021-09-13  发布在  Java
关注(0)|答案(0)|浏览(190)

在这里,文本处于绝对位置,但如果文本更多,则文本在图像上略高。但我希望文本的起点在所有图像上都是相同的,无论段落是少段落还是多段落。有人能告诉我有没有其他方法可以做到这一点。

.case-inner-img {
  position: relative;
  width: 600px;
  background: red;
}

.case-text p {
  position: absolute;
  bottom: 0;
}
<div class="case-inner-img">
  <div class="case-img">
    <a href="#"><img src="https://i.ibb.co/3yLjKqD/inner.png" alt="img"></a>
  </div>
  <div class="case-text">
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It
      has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
      publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
  </div>
</div>

<div class="case-inner-img">
  <div class="case-img">
    <figure><img src="https://picsum.photos/300/200?image=244" /></figure>
  </div>
  <div class="case-text">
    <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
  </div>
</div>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题