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

Home Forums Other Restrict position absolute to certain top value

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #183484

    How can I restrict a div container with position: absolute (bottom: 0;) to a certain top value?

    An example of how I’d like it to work can be found on this page:

    When reducing the height of the browser window the social media icons follow the bottom border of the window up to a certain top value (e.g. 500px) and then stop moving while resting in a certain gap to the logo. Is there a possibility to implement this purely in css or is there JavaScript needed? If JavaScript: Does anyone have the code for this case? Unfortunately I’m an absolute JavaScript layman.

    Also interesting to know would be how I can change an absolute value when reducing the window height (e.g. the logo jumps up some pixels when the window is reaching a certain height).

    Thanks in advance.


    As far as I can see it’s just a nav div positioned at the bottom of the page

    .social {
    position: absolute;
    top: auto;
    bottom: 0;
    padding: 0 0 10px;
    width: 100%;

    No JS

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