Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to place figcaption at the right side of figure?

Tags:

html

css

Question is simple. About html, and css. How to place an html figcaption element at the right side (centered) to the img?

like image 498
GreetingsFriend Avatar asked Apr 10 '17 23:04

GreetingsFriend


1 Answers

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>
like image 115
Michael Coker Avatar answered Oct 05 '22 23:10

Michael Coker