B
B
Bogdan Slomchinsky2014-05-05 21:30:18
css
Bogdan Slomchinsky, 2014-05-05 21:30:18

How do you deal with 1px in line-height (WebKit and Firefox)?

Hello!
Please write in what ways you align the line-height in browsers on the WebKit engine and in Firefox, since there is a difference of 1px. I searched on the Internet, but I did not see a normal answer.
At the moment I use the following construction (crutch):

@-moz-document url-prefix() {#kol_sk{line-height: 0.6;}}

Thanks in advance for your replies.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bogdan Slomchinsky, 2014-05-07
@DiDfree

Maybe someone will need it, "wrote" a simple script that in the firefox browser reduces the value of all line-height by 1 px :

if ( $.browser.mozilla ) {
$('div').each(function() { 
var webkitlh = $(this).css('line-height');
if (webkitlh != 'normal') {
  var mozhlroz = Math.floor(parseInt(webkitlh.replace('px','')) - 1)+'px';
  $(this).css({'line-height' : mozhlroz});
};
});};

ps: it may be written crookedly, but the main thing is that it works =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question