问题
I almost always browse the web with a much bigger font size than default. Makes it much easier to read.
But once in a while I notice that some websites don't allow enlarging the font, at least on Chrome. Like this website for example:
http://en.support.wordpress.com/domains/map-existing-domain/
I am curious, both (a) as to why Chrome allows sites to do that and (b) as to how that is done.
Can someone explain?
回答1:
a) God knows, because browser vendors love to implement things that are bound to get abused?
b)
-webkit-text-size-adjust
is the culprit. See also on MDN and previous question
回答2:
It's a WebKit bug.
-webkit-text-size-adjust
should only have an effect on mobile browsers.
But if you set -webkit-text-size-adjust
to none
, it (mistakenly) affects desktop WebKit browsers (like Chromium/Chrome and Safari), too.
Here is the bug report: https://bugs.webkit.org/show_bug.cgi?id=56543
来源:https://stackoverflow.com/questions/14443430/how-do-some-sites-disallow-changing-font-size