移动端中关于overflow的修复

2018-09-25  本文已影响0人  imxiaochao

移动端在使用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>

上一篇 下一篇

猜你喜欢

热点阅读