I have a element and it is possible that it is longer than one line, so i have to set a line-height>1 otherwise it looks crappy. But if i do that, the lines are higher than the text, and the text is centered. So it does not match the top. How can i change the position of the text to the top of the line, or is there another way to get some space between two lines?
+1
A:
Line height by definition centers the font-size within the given line height. If you have a 12px font and a 16px line-height, the text will be centered within the 16px, leaving 2px on both the top and the bottom.
One solution to push this text up while maintaining the line height is to add a negative margin to the element and push it up negatively:
float: left;
margin-top: -2px;
cballou
2009-11-26 14:15:31
sry cant vote up cause im at work and forgot my login. Not the cleanest solution, but it works. Dont think the float makes any difference. ty
Flo
2009-11-26 14:20:43
A:
Sarfraz
2009-11-26 14:17:42