Mobile browsers horizontal scrollable inside vertical scrollable

霸气de小男生 提交于 2020-01-04 20:16:33

问题


Here's a Fiddle showing the issue.

Basically, I have a div inside a div. Both need scrolling, but one needs horizontal scrolling (the outer one), the other one needs vertical scrolling (the inner one). On a PC this works fine, but on mobile browsers (checked stock Android and mobile Chrome), I can only scroll (slide) horizontally, but not vertically.

Any clues? Code below:

HTML:

<div class="outer">
    <div class="firstContainer">
        <div class="secondContainer">
        </div>
    </div>
</div>

CSS:

.outer {
    width: 320px;
    height: 480px;
    overflow: auto;
}

.firstContainer {
    width: 100%;
    height: 130%;
    background: #808080;
    overflow: auto;
}

.secondContainer {
    height: 80%;
    width: 130%;
    background: #d0d0d0;
    border: 15px solid black;
}

来源:https://stackoverflow.com/questions/24787960/mobile-browsers-horizontal-scrollable-inside-vertical-scrollable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!