无法让内部div滚动
我遇到的问题是,使用下面的代码结构(使用 React),我无法使 ScrollView 滚动。
<Window>
<Sidebar/>
<Body>
<ScrollView>
<Container>
// Inner Container Content goes here
</Container>
</ScrollView>
</Body>
</Window>
- Window 具有
overflow: none;
并将其大小设置为 100% 高度和宽度。 - 侧边栏和正文仅具有定义它们在不同状态下彼此相对大小的CSS属性。
- ScrollView 具有
overflow-y:scroll
以及高度和宽度属性。 - 最后,Container 仅具有大小和样式属性。
我的问题主要与使 ScrollView 的 overflow-y:scroll;
属性实际发生有关,尽管它是 Window 的子级。
我原本希望 ScrollView 能够正常工作,但事实似乎并非如此。
The problem I am having is that with the code structure below (Using React), I am unable to make the ScrollView scroll.
<Window>
<Sidebar/>
<Body>
<ScrollView>
<Container>
// Inner Container Content goes here
</Container>
</ScrollView>
</Body>
</Window>
- The Window has
overflow: none;
as well as setting its size to 100% height and width. - The Sidebar and Body just have CSS properties defining their relative sizes to each other in different states.
- The ScrollView has
overflow-y: scroll
as well as height and width properties. - Finally, Container just has sizing and style properties.
My problem mainly has to do with getting ScrollView's overflow-y: scroll;
property to actually happen despite being a child of Window.
I was expecting the ScrollView to work regardless but that doesn't seem to be the case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论