REM单位不';在Android 2.*和Web View(在Android 4.2之前)本机浏览器中无法正常工作
这是一个bug,我搜索了很长时间,没有找到任何关于它的信息 在我的一个项目中,我开始使用REM单位。在每个有文本的元素中,我都会给出字体大小和行高 我不知道为什么,但不知何故,它不理解REM的线条高度,并表现得好像没有REM一样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
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*/
}