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
在你写的rem布局中,为什么要设置calcMaxWidth = 9999999,还有clientWidth为什么要进行Math.max和Math.min操作呢,直接取html的clientWidth不行吗
The text was updated successfully, but these errors were encountered:
可以看一下这里REM的解析
Sorry, something went wrong.
是为了控制页面能有个最大和最小的宽度,不至于被压缩得错乱,或拉伸得很长。 calcMaxWidth 只是一个参考值,设置很大用以取这个“最大宽度”
if (metaElem.getAttribute('data-content-max') !== null) { calcMaxWidth = defaultMaxWidth; }
meta标签上面的data-content-max属性表示需要开启这个宽度限制的特性,开启了才会限制最大宽度的,不设最小宽度,小的时候肯定会挤得不成样子,所以默认是限制了最小
clientWidth = Math.max(clientWidth, defaultMinWidth * dpr)
说的很好,受教了
No branches or pull requests
在你写的rem布局中,为什么要设置calcMaxWidth = 9999999,还有clientWidth为什么要进行Math.max和Math.min操作呢,直接取html的clientWidth不行吗
The text was updated successfully, but these errors were encountered: