Answer the question
In order to leave comments, you need to log in
How to remove the top margin?
How to remove the top margin from the title? It is clear that this is due to the line-height, but it is not clear how to avoid this. Crutches like margin-top: -13px; use is not suitable. There are many moments in the project when it is necessary to align it this way (because the headers are of different sizes). Is there any generic method? I have not found a solution to this problem anywhere.
Example on JSFiddle
PS
Solved the problem like this https://jsfiddle.net/up26atho/3/ (line-height in percent)
Answer the question
In order to leave comments, you need to log in
It all depends on the font.
If the font has an indent at the top of the letters, then the only way to get rid of it is by adjusting the line-height to the font-size. If not, then everything will be automatic when line-height == font-size
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question