// css
.body{
@media screen and(max-width:450px){
position: fixed;
width: 100%;
}
}
复制代码
body 元素使用fixed 布局,width:100%css
.body{
@media screen and(max-width:450px) {
position: fixed;
top: 0;
bottom: 0;
width: 100%;
overflow-y: scroll;
overflow-x: hidden;
}
}
复制代码
// css
.hide-cursor{
caret-color: transparent; // ios safari 11.1 +支持
}
复制代码
因为 caret-color 只支持 iOS 11.1 +,咱们使用 text-indent来移动行内缩进量,给个足够大的值,形成隐藏光标的做用ios
.fix-ios-safari-11.1{
text-indent: -9999px; // 隐藏光标
margin-left: -50%;
}
复制代码