Forums

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

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #196599
    hello2pig
    Participant

    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!

    #196600
    hello2pig
    Participant

    I tried to add overflow =scroll to section, but it doesn’t work.

    #196602
    Shikkediel
    Participant

    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.

    #196606
    Paulie_D
    Member

    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?

    #196608
    hello2pig
    Participant

    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.

    #196609
    Paulie_D
    Member

    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?

    #196610
    Shikkediel
    Participant

    Hmm… I must have not filtered the exact question here. :-/
    It seemed to be less cryptic than a few of the other recent posts.

    #196611
    Senff
    Participant

    Codepen or it didn’t happen.

    #196614
    hello2pig
    Participant

    Thanks. Using @media resolve my problem.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘Other’ is closed to new topics and replies.