I have text in a <div> that I want centered vertically. Any easy way to do this (non-absolute positioning method).
I have text in a <div> that I want centered vertically. Any easy way
Share
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.
this is another method:
http://jsfiddle.net/SebastianPataneMasuelli/V2D3L/1/
the trick is to make the height of the div the same value as line-height.
this gives you a line of vertically centered text.
there is a way: http://www.jakpsatweb.cz/css/css-vertical-center-solution.html.sorry, that uses absolute positioning.
(but it works)