I have a div that is absolutely positioned.
I'm trying to vertically align it with flex:
.container{
position: absolute;
display: flex;
align-items: center;
justify-content: center;
....
HTML:
<div class="container">
<div>
<p>hello</p>
<p>to</p>
<p>you</p>
...
Is this possible? How else can I vertically align .container
? Please note, I do not wish to use the stretching method.
position: absolute;
top: 0;
bottom: 0;
left:0;
right:0;
margin: auto;
Also the container could be of any height.
p.s. no tables please.