After reading this “In The Woods” blog post, I wondered:
Why isn’t there any one-shot way of vertical centering in CSS3?
Why can’t I just make a <div> with the CSS attribute vertical-align: center and have my content vertically centered?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The name may be slightly confusing. The css declaration
vertical-alignisn’t for vertically centring some content inside its parent (unless we’re talking about table cells). Rather, it is for setting the vertical alignment of the element that the rule is declared upon.This is useful if you’re using
inline-blockto get some elements to sit next to each other and behave.