Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html rem通过媒体查询调整大小在webkit中不起作用?_Html_Css - Fatal编程技术网

Html rem通过媒体查询调整大小在webkit中不起作用?

Html rem通过媒体查询调整大小在webkit中不起作用?,html,css,Html,Css,我在CSS中使用以下代码进行媒体查询: @media all {html { font-size: 62.5%; } }/* 62.5%: 1em = 10px */ @media all and (max-width: 1200px) { html,body { font-size: 50%; } } @media all and (max-width: 1000px) { html,body { font-size: 45%; } } @media all and (

我在CSS中使用以下代码进行媒体查询:

@media all {html { font-size: 62.5%; }  }/* 62.5%: 1em = 10px */
@media all  and (max-width: 1200px) {   html,body { font-size: 50%; }   }
@media all  and (max-width: 1000px) {   html,body { font-size: 45%; }   }
@media all  and (max-width: 800px) {    html,body { font-size: 40%; }   }

但是,虽然字体大小>62.5%的webkit可以正确调整大小,但大小我认为您需要更改媒体查询

@media  (max-width: 800px) {    html,body { font-size: 40%; }   }
@media (min-width:801px) and (max-width: 1000px) {   html,body { font-size: 45%; }   }
@media (min-width: 1001px) and (max-width: 1200px) {   html,body { font-size: 50%; }   }

相关(但不是重复,oops):我发现Chrome(Chrome和Opera)中的rem支持存在缺陷。Chromium基于webkit。我不知道Safari。你可能碰到了缩放错误。AFAIK它是在iPhone1问世时实现的,从未更改过,但您可以使用-webkit text size adjust:none禁用它
@media  (max-width: 800px) {    html,body { font-size: 40%; }   }
@media (min-width:801px) and (max-width: 1000px) {   html,body { font-size: 45%; }   }
@media (min-width: 1001px) and (max-width: 1200px) {   html,body { font-size: 50%; }   }