Take the 2-minute tour ×

Assuming the following HTML:

​<p><span style="font-size: 40px;">A</span>a​​​​​​​​​​​​​​​​​​​​​​</p>​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

Is it possible to get the second character to align to the center of the first?

Actual Result

The second character is aligned to the bottom of the first character in this example:

enter image description here

Expected Result

However, I want the second character to be aligned to the middle of the first character:

enter image description here

share|improve this question

2 Answers 2

up vote 14 down vote accepted

Just add in the vertical-align:middle; style.


share|improve this answer

Add vertical-align:middle; to the <span> (example):

<p><span style="font-size: 40px;vertical-align: middle;">A</span>a</p>​​​​​​​​​​​​
share|improve this answer
the question was changed after I answered it. –  Orbiting Eden May 31 '12 at 18:16
That sucks lol. Update your answer :) –  Shredder May 31 '12 at 18:21

Your Answer


