How do some sites disallow changing font size?

醉酒当歌 提交于 2019-12-23 17:33:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!