image - CSS Vertical Align Objects in Col -
i cannot seem work , spending many hours on this. assuming should simple. looking desired effect of having image on top of text , have them both centered horizontally, have them vertically centered in middle.
any appreciated!
@to15108, can accomplished using flexbox. create one, set display
property value flex
.
from there, can leverage justify-content
, align-items
properties vertical , horizontal centering trying accomplish.
i've included code snippet see how works. make sure expand it's full size.
.d-flex { display: flex; height: 100vh; justify-content: center; align-items: center; } .col { flex: 0 0; max-width: 50%; padding: 0px; margin-right: 5px; text-align: center; }
<div class="d-flex"> <div class="col"> <img src="http://via.placeholder.com/350x150"> <div>some text</div> </div> <div class="col"> <img src="http://via.placeholder.com/350x150"> <div>some text</div> </div> </div>
Comments
Post a Comment