キャプションを画像にどのように揃えることができるかについて質問したいと思います。本当に長いテキストがあります。出来ますか?キャプションを画像に揃える方法は?
<figure>
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=330%C3%97180&w=330&h=180">
<figcaption>Adjusting to school is a noteworthy move in a youthful grown-up's life. For some, the move incorporates moving out of the family home surprisingly, making new companions, and confronting expanded academic demands.
</figcaption>
</figure>
CSS
figure {
display: inline-block;
margin: 20px;
}
figure img {
vertical-align: top;
}
figure figcaption {
text-align: center;
}
上記のコードは、これに得られました。
I COULDN'T UPLOAD IT BECAUSE IT SAYS I NEED 10 REPS TO POST IMAGES, I'M VERY VERY SORRY
JSFiddleを追加して、コードを表示してカスタマイズできるようにしてください。 – Nieck
figureとfigcaptionを使うのはもっと意味があり、divを使うように変更するのは理想的ではありません。 –