Whenever i use a large line-height like 1.6em it always adds a margin in the very top of the text which i don’t want.
Example: http://jsfiddle.net/EstpJ/1/
i want the text to be sharply lined with the borders and not have any kind of top or bottom margin.
How to fix that?
That’s exactly what
line-heightis, it’s a manual way to set the height of a line of text for the purposes of wrapping text and such. The actual visible size is determined by thefont-sizeand to a lesser extend by thefont-family. The averageline-heightfor normal text/font is around1.2em. Anything larger than that will cause visible letterboxing, which is exactly what you are describing. Using a smaller value will cause successive lines to overlap each other.The only way to fix your exact example is introduce more markup to determine line numbers so that you can style the first/last line differently.