<figure>
  <img src="https://assets.techacademy.jp/assets/mentor-about-3-47c6a0fa70343abebff1c25f81298efeabc8f2d9da7a595fb1d8cf9f50780694.jpg" alt="文字の代替">
  <figcaption>文字</figcaption>
</figure>
figure {
  width: 500px;
  position: relative;
}

figure img {
  width: 100%;
  vertical-align: top;
}

figure figcaption {
  font-size: 60px;
  color: #ffffff;
  position: absolute;
  top: 0;
  display: flex;
  width: 100%;
  height: 100%;
  margin: 0;
  align-items: center;
  justify-content: center;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.