Vertical align with 3 lines of CSS
With following lines of css, any container can be aligned vertically, without fixed height or position absolute.
position: relative;
top: 50%;
transform: translateY(-50%);
Written by Razvan Stan
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#