I am using Bootstrap 4 for adding sticky footer which have two components : bottom bar(using container-fluid) with copyright year and website name and sub-footer navigation menu(using container element) which have sitemap and other links.
Here is my css
html {
position: relative;
min-height: 100%;
}
body {
margin-bottom: 40px;
height: 100%;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
}
.footer .container-fluid {
height: 40px;
}
.footer .container {
padding-top: 20px;
}
Whenever I remove those two last footer sub classes and add height:40px; to footer, there is no overlapping of content but a page shows vertical scrollbar even with less content on page.
same problem..
You can use this one to fix your problem:
<body class="d-flex flex-column" style="min-height: 100vh">
<main class="flex-fill"></main>
<footer></footer>
</body>
This seems to be a general HTML/CSS question. What is the problem in Bootstrap?
With bootstrap 4, the content is always shifted up and behind the navbar. So, you need to fix that youself everytime with pure css, which is irritating!! There must be a correct way of doing this.
OK I understand. The Bootstrap sticky footer example is using specific size value (60px). Hopefully the specific size can be removed by using flexbox.
Flexbox based sticky footer solve this issue
Most helpful comment
You can use this one to fix your problem: