We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为移动端开发的页面,目前普遍采用下面的代码来设置整体页面的 font-size,这样就可以用 em 来设置各元素的尺寸。 但是随之而来的一个问题就是,由于页面本身默认有自己的 font-size,用下面的代码重新设置 font-size 之后,由于页面先加载的 CSS,后加载的 JS,所以在页面刚加载完成后的一小段时间内,页面上各元素的体积都非常大,用户体验不佳。
em
document.documentElement.style.fontSize = window.innerWidth / 100 + 'px'
为了解决上面的问题,所采用的解决方式为:
display: none;
document.addEventListener('DOMContentLoaded', function () { document.body.classList.remove('hidden') }, false)
在 iPhone 4 iOS 7 和 三星平板的 Android 4.4.2 系统上均测试成功,可全面应用。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
需求描述
为移动端开发的页面,目前普遍采用下面的代码来设置整体页面的 font-size,这样就可以用
em
来设置各元素的尺寸。但是随之而来的一个问题就是,由于页面本身默认有自己的 font-size,用下面的代码重新设置 font-size 之后,由于页面先加载的 CSS,后加载的 JS,所以在页面刚加载完成后的一小段时间内,页面上各元素的体积都非常大,用户体验不佳。
解决方案
为了解决上面的问题,所采用的解决方式为:
display: none;
,让页面刚加载的时候不显示 body。兼容情况
在 iPhone 4 iOS 7 和 三星平板的 Android 4.4.2 系统上均测试成功,可全面应用。
The text was updated successfully, but these errors were encountered: