Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Scrolling div within div

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36095
    djpic
    Participant

    I am trying to make a div, then have another div contained with the parent div which has a determined height. But when doing this, the right scroll bar goes beyond the height of the containing div. How can I fix this? Here is the link: Click Here

    #94554
    tmette
    Member

    I think you need to make the height on the scrollable div smaller than 100%. It can’t take up 100% of the parent container because of the other content within it. I just kind of guessed on how the height would be through trial and error to get the scroll bar to fit. Try this code:



    .scrollable {
    height: 69%;
    overflow: auto;
    }


    #94555
    djpic
    Participant

    I started playing with it more, and saw that is what I had to do. But my thought process was, 100% meant it would take up 100% of what ever space was remaining. But then when thinking with widths, it is always whatever percentage of the parent value so makes sense it would work the same way of course. I deal with widths more the height usually.

    Thanks.

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