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
苹果 websites 设计规范
padding-bottom: constant( safe-area-inset-bottom); /* 兼容 iOS < 11.2 */ padding-bottom: env( safe-area-inset-bottom); /* 兼容 iOS >= 11.2 */
注意:env() 跟 constant() 需要同时存在,而且顺序不能换
@supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) { .iphone-x { padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); } }
非x 系列设备,距离底部距离
@supports (bottom: constant(safe-area-inset-bottom)) or (bottom: env(safe-area-inset-bottom)) { .iphone-x { padding-bottom: calc(10rpx + constant(safe-area-inset-bottom)); padding-bottom: calc(10rpx + env(safe-area-inset-bottom)); } }
The text was updated successfully, but these errors were encountered:
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,viewport-fit=cover" />
body { /* 适配齐刘海*/ padding-top: constant(safe-area-inset-top); padding-top: env(safe-area-inset-top); /* 适配底部黑条*/ padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); }
Sorry, something went wrong.
No branches or pull requests
苹果 websites 设计规范
安全区示意图
小程序中适配
注意:env() 跟 constant() 需要同时存在,而且顺序不能换
使用 @supports 隔离兼容样式
效果展示
同样也支持 calc 写法
非x 系列设备,距离底部距离
The text was updated successfully, but these errors were encountered: