Forums

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

Home Forums CSS Need some help with stretching a div

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

    Hi everyone,

    I need some CSS help!

    I have a div that has an absolute position, with the top set to 620px.
    I am having a hell of a time trying to get this div to stretch down to the bottom of the page
    right now I am using a background image to make it looks like it is stretching, but I really
    want to get rid of that and use pure css.

    I tried making it’s height 100%, but that makes the page 620px longer than it needs to be.

    Can anyone help me out?

    #77806
    Avalic
    Participant

    Ok so I found a solution,
    I made a wrapper div, with the height set to 100% and overflow set to hidden.
    I put the div I needed to stretch inside it, with a height set to 100% and a top margin of 620px.

    This seems to be working nice, however if someone knows of a better way to do this, I would love
    to hear!

    Thanks

    #77751
    noahgelman
    Participant

    It’s absolutely positioned with {top:620px;} right? Also add {bottom:0;} and it’ll stay stretched to the bottom. At least to the bottom of the relative it. If that’s the body then you’ll be just fine.

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