2014-04-04 65 views
1

我的網站在除Firefox以外的所有瀏覽器中都能很好地工作。出於某種原因,瀏覽器將文本的大小增加得比其他任何瀏覽器都大,並且將文本從其div中移出。我如何才能使文本更小,只有Firefox?如何在Firefox瀏覽器中更改字體大小

我曾嘗試這個代碼,但沒有奏效,

<script> 
    if ($.browser.mozilla) { 

     $('.first_develop_div').css({ 
     'font-size': '12px' 
     }); 
     $('.second_develop_div').css({ 
     'font-size': '12px' 
     }); 

    }//end if firefox 

    </script> 
+0

是否只發生在您的Firefox或每個人的? –

+0

您是否嘗試過:http://detectmobilebrowsers.com/ >> http://detectmobilebrowsers.com/download/javascript –

+0

也許'.css({...})'部分是不工作的部分,它可能會被其他繼承的風格或類覆蓋 –

回答

0

使用此,它可以幫助...

if(navigator.userAgent.indexOf("Firefox") != -1) {  
    $('.first_develop_div').css({ 
    'font-size': '12px' 
    }); 
    $('.second_develop_div').css({ 
    'font-size': '12px' 
    }); 
return "Firefox"; 
} 
else { 
return "unknown"; 
} 
相關問題