css - Can using line-height < 1 cause problems? -


i'm using specific font (font-size: 16px). when use line-height:1, character's baseline not positioned @ bottom. there 2px gap:

screen shot of 2 lines of text next each other. on left text says "line-height:1 e g" , on right says "line-height:0.75 e g". text on right has 2px between gray background , red top , bottom borders.

if reduce line-height 0.75 better results. can align text in more precise way other elements. can implement spacings defined in graphic mockups without doing calculations. using padding-bottom can control line spacing.

does setting line-height < 1 have side-effects should aware of? supported today's browsers in concise way?

i not call "bad practice" though can cause ugly results when text wraps on multiple lines. using "alignment-hacks" said should no problem @ all.

edit:

maybe answer promised much. careful line-height property beacause mentioned may cause ugly results on multi-line text. if want keep website responsive margins on paragraphs (positive or negative) better solution.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -