首页 > 解决方案 > HTML 中的照片和文本

问题描述

我试图在照片旁边放一些文字,我希望这些文字在图像下方流动。我使用了图形标签和figcaption标签,但它不起作用。

<figure>
  <img class="row2" src="http://placekitten.com/150/150">
  <figcaption class="text">Email filtering is the processing of email to organize it according to specified criteria. </figcaption>
</figure>

标签: htmlcssphotofigure

解决方案


如果您只是希望您的标题与图像大小相同并位于其下方。给一个宽度figure

figure{
  width: 300px;
}
img{
  max-width: 100%;
  display: block;
}
<figure>
  <img class="row2" src="http://placekitten.com/450/450">
  <figcaption class="text">Email filtering is the processing of email to organize it according to specified criteria. </figcaption>
</figure>


推荐阅读