Forums

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

Home Forums CSS Contain a fixed element inside a relative one

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30600
    dcp3450
    Participant

    What I’m trying to do seems relativly simple:

    I have a fixed element (div) that I want to scroll with the page. It is inside a position: relative element so it will not go past top of that container. All that works perfect. However, I want the fixed element to stay within the containing div. so when the bottom of the fixed div reaches the bottom of the container it stops scrolling with the page.

    I was hoping to do this with CSS but maybe I have to use jquery. Any suggestions?

    #77624
    ImpInaBox
    Member

    Would this work div {height:100%; overflow:auto;} ? Or ‘overflow:scroll;’ if you don’t mind scroll bars being present even if the contained div is small enough not to need them.

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