Question is simple. About html, and css. How to place an html figcaption element at the right side (centered) to the img?
display: flex; align-tiems: center
on the parent.
figure {
display: flex;
align-items: center;
}
<figure>
<img src="http://kenwheeler.github.io/slick/img/fonz1.png">
<figcaption>caption</figcaption>
</figure>
Or make them inline-block
and use vertical-align
img,figcaption {
display: inline-block;
vertical-align: middle;
}
<figure>
<img src="http://kenwheeler.github.io/slick/img/fonz1.png">
<figcaption>caption</figcaption>
</figure>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With