user3926604
user3926604

Reputation: 189

fixed font size not affected by zoom in or out

How can I make a fixed font size not affected by zoom in or out?
I have tried using font-size: 100%; but when I zoom in or out the font size doesn't remain 100%, it keeps changing.

Upvotes: 1

Views: 3109

Answers (1)

TeeDeJee
TeeDeJee

Reputation: 3741

You may use following css attribute. With all the browser prefixes. But this will only work on some browsers and mostly on mobile browsers.

-webkit-text-size-adjust:none
text-size-adjust: none

If -webkit-text-size-adjust is explicitely set to none, Webkit-based desktop and tablet browsers, like Chrome or Safari, instead of ignoring the property, will prevent the user to zoom in or out the Web page.

You can look https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust for more info and compatibility.

Upvotes: 2

Related Questions