Android Stock Browser Not Respecting CSS Overflow

前端 未结 2 2004
南笙
南笙 2021-02-19 01:37

I\'m working with a client who would like part of their interface to have a somewhat customized method of scrolling. They don\'t want the usual scrollbars to be visible; they wa

2条回答
  •  孤城傲影
    2021-02-19 01:51

    I believe Android stock browser doesn't support x/y-specific overflow properties. Instead of turning on overflow-y, turn on overflow then turn it off for overflow-x. Example:

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-y: scroll;
    }
    

    should become:

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        overflow: scroll;
        overflow-x: visible;
    }
    

    Generally I use auto instead of scroll so the scroll bars won't show up if not necessary. Also, perhaps overflow-x: hidden; may be more desirable in your situation. Basically this will apply your desired overflow-y property to overflow-x as well, but usually this is more desirable than the rule being ignored completely. For browsers that support the axis-specific overflows the user won't know the difference.

提交回复
热议问题