Search code examples
javascripthtmlcsstwitter-bootstrapparallax

Parallax Positioning Problems Bootstrap 4


I am learning how to do Parallax and Bootstrap 4 and I am having issues having the result of this website: Sample Website

On his website, the homepage is the same size on all platforms, laptop | Desktop | Mobile, etc.. I am trying to get the same result but I am having very much issues on achieving it. I do not know its proper name which is why I am asking Overflow because if I do not know what it is properly called or how to describe it, how can I get a relative search result? Please help and don't hate on me for probably easy question, I am still new to this. Thanks!


Solution

  • In the containing div of that topmost section you could set the height to

    .exampleContainer{
        height:100vh;
    }
    

    vh stands for 'viewport height' if you wanted to for width you could use 100vw for 'viewport width' instead of 100%

    you might need to account for the height of the navbar so your css could look something like this...

    .exampleNavbar{
        height: 5rem;
    }
    
    .exampleContainer{
        height: calc(100vh - 5rem);
    }