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!

a = row, b = column, c = image, d =

of text

@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

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -