Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.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/9/apache-flex/4.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
REM单位不';在Android 2.*和Web View(在Android 4.2之前)本机浏览器中无法正常工作_Android_Css_Webview_Android Webview - Fatal编程技术网

REM单位不';在Android 2.*和Web View(在Android 4.2之前)本机浏览器中无法正常工作

REM单位不';在Android 2.*和Web View(在Android 4.2之前)本机浏览器中无法正常工作,android,css,webview,android-webview,Android,Css,Webview,Android Webview,这是一个bug,我搜索了很长时间,没有找到任何关于它的信息 在我的一个项目中,我开始使用REM单位。在每个有文本的元素中,我都会给出字体大小和行高 我不知道为什么,但不知何故,它不理解REM的线条高度,并表现得好像没有REM一样 html{ font-size:1px; } .fu{ font-size:20rem; line-height:24rem;/*old android, act like 24 without the REM Unit*/ } /*normal brow

这是一个bug,我搜索了很长时间,没有找到任何关于它的信息

在我的一个项目中,我开始使用REM单位。在每个有文本的元素中,我都会给出字体大小和行高

我不知道为什么,但不知何故,它不理解REM的线条高度,并表现得好像没有REM一样

html{
  font-size:1px;
}

.fu{
  font-size:20rem;
  line-height:24rem;/*old android, act like 24 without the REM Unit*/
}
/*normal browser - line-height 24*1 = 24px(root-font-size)
old android browser and webview line-height 24 * 20(font-size) = 480px*/
(在桌面和旧android中观看)


我很乐意找到一个合适的解决方案,使我能够在行高中使用REM单位。

Yo无法在android 2中使用REM行高*

解决方案:

使用字体大小的倍数

示例

html{
  font-size:1px;
}

.fu{
  font-size:20rem;
  line-height:1.2; /*1.2 equal to 24rem(in this case) and will resolve conflict in old android*/
}