CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue

后端 未结 6 871
孤街浪徒
孤街浪徒 2020-11-21 06:27

Suppose you have some style and the markup:

6条回答
  •  天涯浪人
    2020-11-21 07:13

    After some serious searching it seems i've found the answer to my question:

    from: http://www.brunildo.org/test/Overflowxy2.html

    In Gecko, Safari, Opera, ‘visible’ becomes ‘auto’ also when combined with ‘hidden’ (in other words: ‘visible’ becomes ‘auto’ when combined with anything else different from ‘visible’). Gecko 1.8, Safari 3, Opera 9.5 are pretty consistent among them.

    also the W3C spec says:

    The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as their specified values, except that some combinations with ‘visible’ are not possible: if one is specified as ‘visible’ and the other is ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’. The computed value of ‘overflow’ is equal to the computed value of ‘overflow-x’ if ‘overflow-y’ is the same; otherwise it is the pair of computed values of ‘overflow-x’ and ‘overflow-y’.

    Short Version:

    If you are using visible for either overflow-x or overflow-y and something other than visible for the other, the visible value is interpreted as auto.

提交回复
热议问题