Disable Chrome minimum font-size 10px

2019-02-13 05:07发布

问题:

I got some text with

font-size:9px

But it is displaying correctly in Safari and Firefox but not with Mac/Chrome (V32).
Left is chrome [bad] / Right is Safari [correct]

I can see in the code inspector that my font is 9px but chrome switch to 10px :

I heard about the minimum font size in chrome and tried to disable the auto adjustment by following style but did not work.
Any idea?

* {
    -webkit-text-size-adjust: none;
}

回答1:

i can only tell WHY it's not working but this might help you to go looking for a different way to solve your problem.

from chrome version 28.0.1500.11 chrome doesn't support -webkit-text-size-adjust anymore. (changelist is here: http://trac.webkit.org/changeset/145168). and safari follows along. on newer mac os versions text-size-adjust is already gone too.

I have problems with it as well, since i've built a whole website on rem units to make it not only responsive but totally flexible. this worked pretty nice but all of a sudden everything is huge now. i'm working hard on a solution for this, but if anyone has an idea i didn't think of i'd appreciate that very much.

as soon as i find a solution i'll come back to let you know.