[英]How do I get this child element with overflow auto to show when the parent is overflow hidden?
As you can see I'm trying to create a full screen overlay navigation. 如您所见,我正在尝试创建全屏覆盖导航。 I have set the body height to 200%, and when the overlay nav shows I set the body to overflow: hidden;
我将主体高度设置为200%,并且当覆盖导航显示时,我将主体设置为overflow: hidden;
. 。
I've also set the important overlay navigation properties to: 我还将重要的叠加层导航属性设置为:
.flexbar .overlay-menu {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 150%;
overflow: auto;
}
I set the height 150% for test purposes on the off-chance that there are more menu items than the screen can show on smaller screens. 我出于测试目的将高度设置为150%,以免出现菜单项多于在小屏幕上无法显示的菜单项的情况。 I want the user to be able to scroll within the overlay navigation, but for some reason my overflow: auto;
我希望用户能够在覆盖导航中滚动,但是由于某种原因我的overflow: auto;
isn't working? 不工作吗
I think in the long run, messing with height (150%, 200%) is going to affect your layout. 从长远来看,我认为弄乱高度(150%,200%)会影响您的布局。 I forked your JSFiddle, and changed the heights back to 100%. 我分叉了您的JSFiddle,并将高度重新设置为100%。 I also used overflow-x: scroll
, which I think should solve your issue if I am understanding your question correctly. 我还使用了overflow-x: scroll
,如果我正确理解了您的问题,我认为应该可以解决您的问题。
Fiddle: https://jsfiddle.net/52gsf85c/ 小提琴: https : //jsfiddle.net/52gsf85c/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.