<style type="text/css">
.vertical-center {
min-height: 100%; /* Fallback for browsers do NOT support vh unit */
min-height: 100vh; /* These two lines are counted as one :-) */
display: flex;
align-items: center;
}
</style>
Regards,
JiyaoLee
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
Member
4 Points
45 Posts
Vertically center align images in dynamic height
Feb 13, 2017 05:32 AM|ganesh88maddy|LINK
Vertically center align images in dynamic height
I've dynamic height for one div in that i need Vertically center align multiple images inside that div.
I tested css display-table and flex but no result. if any Javascript or Jquery thats fine
All-Star
15186 Points
3888 Posts
Re: Vertically center align images in dynamic height
Feb 14, 2017 04:58 AM|raju dasa|LINK
Hi,
Try using vertical-align:middle css rule
or, check the solution here: http://stackoverflow.com/questions/18649106/div-vertical-align-middle-css
rajudasa.blogspot.com || rajudasa-tech
Member
600 Points
262 Posts
Re: Vertically center align images in dynamic height
Feb 14, 2017 09:26 AM|JiyaoLee|LINK
Hi ganesh88maddy,
Do you mean that the multiple images have different height?I create a demo, and hope to help you,
1. It is the page, the image is in the div container. The "container" div will show vertically center align
2. Add style(vertical-center)
Regards,
JiyaoLee