http://i.stack.imgur.com/rU410.png
我希望图像是不言自明的。包含的 div 具有可变高度。产品列表可以扩展到此包含 div 之外 - 如果列表大于包含 div,我希望列表滚动。显然,应用 overflow: scroll to the containing div 滚动整个 div 而不仅仅是列表。我怎样才能做到这一点?
谢谢
最佳答案
给 child div position: absolute 应该可以解决您的问题:
子元素:
position: absolute;
top: 0px;
bottom: 0px;
overflow: scroll;
/* and so on */
父级:
position: relative;
关于html - '溢出 : scroll' on a child div when overflowing the parent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33648380/