I am trying to vertically align to the middle both an image and some text within a list element but having no luck.
eg:
<ul>
<li><img src="somepath" /> sometext
</li>
<li><img src="somepath2" /> sometext2
</li>
</ul>
how can i do it?
thanks
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.
Assuming your list items have a fixed height, you can use
line-heightcombined withvertical-align: middleto do this.Example:
Working example here.