Ask your Question

Write to us

Ask Question

How to make content/div vertically middle align without absolute, tablecell and he

Shailesh Kumar

Hi team,

How to make content/div vertically middle align without absolute, tablecell and height? No matter how outer div are longer in height but my content and div should be middle align vertically.

Please provide me some better solution.

Shailesh Kumar
profile Pushpendra 10th July 2017

Hi Shailesh,

you can make content/div vertically middle align by using css mentioned below :

.center-content {
/* Anything inside me will be vertically centered */
display: flex;
flex-direction: column;
justify-content: center;
height:/* whatever you want */;
}

 

--

Pushpendra Singh

Shailesh
24-07-2017 00:00

Hi Pushpendra, Thanks for sharing the code but i do not want to add height. Please any solution without the height?

Write a comment ...
Post comment
Cancel