I have a div that is 1/5 the vh of the screen. I want the image within that div to be centered vertically. I am able to center it horizontally but have tried the following code thus far:
img{
width:25px;
}
.container-fluid > div{
text-align:center;
height: calc(100vh/5);
}
.container-fluid > div:nth-child(odd){
background:yellow;
}
<div class="container-fluid">
<div><img src="http://ift.tt/1EJ5PmC"></div>
<div><img src="http://ift.tt/1EJ5PmC"></div>
<div><img src="http://ift.tt/1EJ5PmC"></div>
<div><img src="http://ift.tt/1EJ5PmC"></div>
<div><img src="http://ift.tt/1EJ5PmC"></div>
</div>
Aucun commentaire:
Enregistrer un commentaire