- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Other › [Solved] how to Allow some of sections scrollable on set body: overflow=hidden
I have a website with structure like
<body>
<section></section>
<section></section>
…
</body>
I set body{overflow:hidden} to disable scroll bar and use nav button to switch each section. each section’s default height is 100vh, and also has a min-height. My question is : how Can I set section scroll when viewport height is less than min-height? Thanks!
I tried to add overflow =scroll to section, but it doesn’t work.
I’d use a media query to either set overflow hidden on body or not. It would be determined by the minimum height of the sections.
It’s not clear to me what you are trying to do.
What do you mean by ‘scrolling’…??
Are you using JS to scroll to sections.
If the ‘default’ height is 100vh…is this not the min-height?
Sorry to make confusion. No, 100vh is not min-height.
The whole website is not scrollable. I use navigation button to jump to each section. However,when section’s min-height is larger than 100vh,I need to set that only that section scrollable. This is what I need to do.
However,when section’s min-height is larger than 100vh
Then what is the `default’ height and why is this 100vh?
A min-height would have to be set…
Do you mean that the height of the content would normally cause the div exceed 100vh but if it does then you want that div to have a scroll-bar?
Hmm… I must have not filtered the exact question here. :-/
It seemed to be less cryptic than a few of the other recent posts.
Codepen or it didn’t happen.
Thanks. Using @media resolve my problem.