We help IT Professionals succeed at work.

Vertically Aligning Inner Elements

APD Toronto
APD Toronto asked
on
Hi Experts,

I have always had issues with this, but how do I vertically center inner elements, such as a div within div?
Comment
Watch Question

Senior Director of Technologyy
Commented:

There are several ways of doing this.  Kind of depends on what you are trying to do around it.  I think one of the easiest ways is to do display: flex on the parent and then updating the justify-content, flex-direction and align-items values to get it to center the way you want.


Hope this helps some.


https://css-tricks.com/snippets/css/a-guide-to-flexbox/