Forums

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

Home Forums CSS Setting The Height To The Height Of the Page Whilst Using A Sticky Footer.

  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #174563
    KKHAN
    Participant

    Hi,

    I am trying to set the height of the content to the height of the page, whilst using a sticky footer.

    .content-main {
    
    border-right:1px solid #cbcbcb;
            height: 100%;
    min-height: 100%;
    }

    However, this is not taking effect (border does not show full height of page). Is there a hack or work around for this?

    Condensed code. CodePen

    #174565
    Paulie_D
    Member

    Does the .content-main div contain nothing but floated or positioned elements?

    If so, it’s collapsing to zero height which is why the border isn’t showing up.

    As a quick clearix (like overflow:hidden) and the border shows up and expands to the bottom of page if the content is long enough…click you ‘setting’ li to see.

    #174584
    KKHAN
    Participant

    Yes

    overflow:hidden does bring the border. But can you see how the border is not 100% height of the page. Which is what i am after. Which you have mentioned depends on the height of the content.

    However, i do not want it to depend on the height of the content, the min-height should always be 100%. So the border needs to go all the way down the page.

    I’m just at a complete loss. Is this just a hard technique to implement? Am i doing it an awkward way? Is there a better way to implement the EXACT same layout/functionality?

    #174590
    jurotek
    Participant

    Please see this FORK if that’s what you after.

    #174607
    KKHAN
    Participant

    @jurotek

    Can you see whats wrong with what uve changed and why it might not suit what i want?

    1. The Footer is now in a contained width and not full width of the page.
    2. The Heights are still not height of the page. Just have a look at the borders to work that out.

    Sorry, this is not what i am after :(

    #174635
    jurotek
    Participant

    How about this THIS?

    #174637
    KKHAN
    Participant

    @jurotek

    No, there is not much leeway i am willing to give. If exactly what i want can’t be done with my code i am willing to change, instead of trying to hack it. You’re second example still has border problems. I know this can be done ive seen it on other sites.

    Im surprised no one has posted a solution yet, makes me wonder if this is just hard to implement?

    #174640
    jurotek
    Participant

    What problem with borders you referring to. They’re 100% of page height as you wanted and footer is now 100% width.

    #174643
    Paulie_D
    Member

    Im surprised no one has posted a solution yet, makes me wonder if this is just hard to implement?

    I’m not sensing a lot of gratitude for the work people are putting in to solve your design problem.

    If you want quick solutions…hire someone.

    #174668
    KKHAN
    Participant

    @Paulie_D

    Im not after a quick solution, i was surprised it is a bigger problem than i initially thought. I am thankful that i can go somewhere to get help. Just frustrated as i don’t think im explaining the problem properly from the solution e.g @jurotek is recommending me.

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