Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1150851

    Buttermelts
    Participant

    Hello,

    I’m trying to set the height of a section to 100vh minus the height of the navbar, but the following doesn’t work for me:

    #x-section-1 {
    min-height: calc(100vh-50px);
    }

    If I just use

    #x-section-1 {
    min-height: 100vh;
    }

    it functions as expected, but I can’t seem to use calc() successfully. Also how do I make it subtract the height of the navbar instead of a set number of pixels?

    Thanks,

    #1150867

    Nico
    Moderator

    Hi There,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Thanks.

    #1150889

    Buttermelts
    Participant
    This reply has been marked as private.
    #1151031

    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the url of your site. Your css code is using the wrong style. It should be max-height thus having this code instead:

    #x-section-1 {
      height: 100vh;
      max-height: calc(100vh-50px);
    }

    Hope this helps. Please let us know how it goes.