Why won’t vertical-align: middle work? And yet, vertical-align: top does work.
span{ vertical-align: middle; }
<div> <img src='https://via.placeholder.com/30' alt='small img' /> <span>Doesn't work.</span> </div>
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.
Actually, in this case it’s quite simple: apply the vertical align to the image. Since it’s all in one line, it’s really the image you want aligned, not the text.
Tested in FF3.
Now you can use flexbox for this type of layout.