小技巧模仿微信解决IOS端fixed定位失效问题

406 阅读1分钟

<!DOCTYPE html>





ios 固定定位失效
<br> <em> {<br> margin: 0;<br> padding: 0;<br> }<br> html, body, .wrap {<br> width: 100%;<br> height: 100%;<br> }<br> .wrap {<br> /</em>overflow: scroll;<br> -webkit-overflow-scrolling: touch;<em>/<br> }<br> .myhead {<br> position: fixed;<br> top: 0;<br> left: 0;<br> width: 100%;<br> height: 48px;<br> overflow: hidden;<br> background: yellowgreen;<br> z-index: 10;<br> }<br> .title {<br> font-size: 18px;<br> font-weight: bolder;<br> text-align: center;<br> font-family: &quot;microsoft yahei&quot;;<br> }<br> .mybody {<br> position: relative;<br> top: 0px;<br> padding-bottom: 90px;<br> width: 100%;<br> height: 100vh;<br> overflow: scroll;<br> -webkit-overflow-scrolling: touch;<br> }<br> .content {<br><br> line-height: 20px;<br> text-align: center;<br> font-size: 14px;<br> color: black;<br> background: #fbfbfb;<br> }<br> .myfoot {<br> position: fixed;<br> bottom: 0;<br> left: 0;<br> width: 100%;<br> height: 90px;<br> background: #FFFFFF;<br> }<br> .anwser {<br> width: 200px;<br> height: 50px;<br> border: 1px solid #DDDDDD;<br> margin: 20px 0 0 20px;<br><br> }<br> .send {<br> width: 50px;<br> height: 40px;<br> background: yellowgreen;<br> color: white;<br> }<br> .b1{<br> position: fixed !important;<br> top: 0 !important;<br> right: 0 !important;<br> bottom: 0 !important;<br> left: 0 !important;<br> width: 100% !important;<br> height: 100% !important;<br> padding: 0 !important;<br> margin: 0 !important;<br> overflow: hidden !important;<br> -webkit-overflow-scrolling: touch;<br> }<br> .b2 {<br> position: absolute!important;<br> }<br>






这是内容1


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容2


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容


这是内容3





点击发送