Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why some font-sizes rendered larger in mobile browsers?

My website's homepage have some h and div elements. The first h2 tag's and div tag's font sizes are with px. I have "-webkit-text-size-adjust: none;" spesification in html and body tags also. However the first tags's font size's rendered bigger in mobile browsers. Why? How can I solve this problem?

css codes:

h2 {
font-size: 16px;
}
#main h2 {
font-size: 16px;
font-weight: normal;
margin: 0;
}

.introdiv {
font-size: 12px;
line-height: 1.3;
margin: 0;
padding: 0 10px 24px 3px;
}
like image 442
user3620931 Avatar asked Oct 24 '25 01:10

user3620931


2 Answers

Try adding this into the head tag of your HTML.

<meta name="viewport" content="width=device-width, initial-scale=1.0">
like image 79
korsun Avatar answered Oct 25 '25 15:10

korsun


text-size-adjust: none;, if you must force them not to do that.

like image 25
Константин Ван Avatar answered Oct 25 '25 15:10

Константин Ван



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!