views:

46

answers:

3

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?

A: 

In which context u r taking abt

asb
+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
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
A: 
Sarfraz