美文网首页
移动端中关于overflow的修复

移动端中关于overflow的修复

作者: imxiaochao | 来源:发表于2018-09-25 16:24 被阅读0次

移动端在使用overflow-x:hidden属性时,如果直接加在body上无效,需将内容包裹在另一个div标签中,并且使用 overflow-x:hidden;postion:relative,两个属性,如:

<div style="overflow-x:hidden;position:relative">
    <section style="width:100%;height:100%">
    </seciton>
    <section style="tanslateX-100">
    </seciton>
</div>
<style>
.tanslateX-100{
    width:100%;
    height:100%;
    transform: translateX(100%);
    transition: all 0.5s;
    position: absolute;
    top: 50px;
    opacity: 1;
}
<style>

相关文章

网友评论

      本文标题:移动端中关于overflow的修复

      本文链接:https://www.haomeiwen.com/subject/ixyloftx.html