overflow-x和overflow-y的冲突问题

qq_33777786 2016-11-23 05:05:16
overflow-x和overflow-y,如果两个值不同,另一个就会被默认改成auto,我想要的效果是,在一个div里面,上下有滑动框,左右没有,左右方向可以溢出
...全文
1848 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
whl401765060 2018-04-12
  • 打赏
  • 举报
回复
w3c标准就是这么写的
引用
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’.
详细信息和解决方法请移步https://stackoverflow.com/questions/6421966/css-overflow-x-visible-and-overflow-y-hidden-causing-scrollbar-issue/
GustavoLi 2017-11-16
  • 打赏
  • 举报
回复
overflow-x:hidden ;overflow-y: scroll;
q2429511833 2017-11-09
  • 打赏
  • 举报
回复
题主现在解决了吗?同样的需求效果,父级纵向滚动,鼠标移到子级显示绝对定位到右边的孙子级。
当作看不见 2016-12-05
  • 打赏
  • 举报
回复
overflow-x: hidden;
  • 打赏
  • 举报
回复
overflow-x:hidden ;overflow-y: auto; 内部div的高河宽都要大于外部
qq_33777786 2016-12-02
  • 打赏
  • 举报
回复
[quote=引用 1 楼 qq_19972169 的回复:并不管用。。
_Star_ 2016-11-24
  • 打赏
  • 举报
回复
overflow:hidden;

39,084

社区成员

发帖
与我相关
我的任务
社区描述
HTML5是构建Web内容的一种语言描述方式。HTML5是互联网的下一代标准,是构建以及呈现互联网内容的一种语言方式.被认为是互联网的核心技术之一。
社区管理员
  • HTML5社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧