Bootstrap 4 Sticky Footer Position Issue

I am currently working on a web application frontend using Bootstrap 4 and facing an issue with creating a footer that remains at the bottom of the viewport regardless of content length. I have seen similar questions raised before, but none of the suggested solutions seem to work for me. In essence, I want the footer to start at the bottom of the page if the content does not fill the entire page, without having a fixed footer that covers content when scrolling.

Below is the HTML code snippet I have so far:


<footer class="container-fluid text-center py-5 mt-auto footer" id="footer">
    <div class="row mx-auto footer-row">
        <div class="col-md-12"></div>
        <div class="col-12 col-md">
            <i class="fas fa-dna footer-dna fa-2x"></i>
        </div>
        <div class="col-6 col-md">
            <h5>Features</h5>
            <ul class="list-unstyled text-small">
                <li><a href="#">Cool stuff</a></li>
                <li><a href="#">Random feature</a></li>
                <li><a href="#">Team feature</a></li>
                <li><a href="#">Stuff for developers</a></li>
                <li><a href="#">Another one</a></li>
                <li><a href="#">Last time</a></li>
            </ul>
        </div>
        <div class="col-6 col-md">
            <h5>Resources</h5>
            <ul class="list-unstyled text-small">
                <li><a href="/newsletter">Sign Up For Email</a></li>
                <li><a href="#">Resource name</a></li>
                <li><a href="#">Another resource</a></li>
                <li><a href="#">Final resource</a></li>
            </ul>
        </div>
        <div class="col-6 col-md">
            <h5>About</h5>
            <ul class="list-unstyled text-small">
                <li><a href="#">Team</a></li>
                <li><a href="#">Locations</a></li>
                <li><a href="#">Privacy</a></li>
                <li><a href="#">Terms</a></li>
            </ul>
        </div>
    </div>
</footer>

Currently, the footer appears below the final content on the page rather than staying fixed at the bottom based on content length. You can view the codepen link with the HTML and CSS here: https://codepen.io/franchise/pen/LYpjxYM. Any insights on what might be causing this issue would be greatly appreciated. Thanks in advance for your assistance.

Answer №1

#bottom {
  background-color: #951010;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  color: #FFF;
}

Update the bottom element with this style.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to add a media query to a <style> element?

I have implemented Skrollr for my Parallax animations, allowing me to use Parallax keyframes without writing them inline. To make the plugin utilize external stylesheets for the keyframes, it uses AJAX to locate the stylesheets imported via <link>. ...

Adjust the size of a nested div within a bootstrap container

My dilemma arises when nesting a product slider div inside a bootstrap col-lg-x div, as illustrated below: https://i.sstatic.net/9tCVA.png The issue lies in the layout distortion that occurs within a div.row > div.col-lg-8 structure, where images are ...

Display the div only when it has finished loading using jQuery's hide()

I have integrated a tabbed featured post on my blog and I am facing an issue. How can I apply the div#latest-featured to be hidden using hide() method and then displayed again once the content is fully loaded? $(document).ready(function() { //Default ...

PHP receive apostrophe from $_GET array

Similar Question: “slash before every quote” issue Hello there, I am currently attempting to utilize $_GET in order to transmit the contents of a text box to another php file. However, whenever I include single (') or double (") quote ...

Unable to retrieve the textContent of an HTML element, however, it is possible to log it

Currently, I'm attempting to make changes to a table on the following website. I've inserted the script below into the console of both Chrome and Firefox: let skins = [ "button" //simplified ]; skins.forEach((skin)=>{ document.que ...

Dynamic parallax effect with scroll wheel on WebKit

Currently experiencing some challenges with parallaxing backgrounds. I developed a website for an event organized by my friends, featuring multiple background images that shift between content sections to create a parallax effect. I have implemented code t ...

The property 'innerHTML' cannot be assigned to null, as stated in Vue

I am dealing with two components that allow for editing JSON objects. Additionally, I have a button that toggles between these two components. Below is the HTML code snippet: <v-btn @click="switchConfigClicked">Switch config</v-btn> <h4 cla ...

What criteria need to be met for height: 100% to be displayed correctly?

Although I haven't had the need to use this often, there are times when it proves to be useful... when it decides to cooperate. It's interesting how sometimes the height: 100%; code works perfectly, while other times it seems to fail. It leaves ...

Sending information from a parent component to a child component within an Angular application

How can I efficiently pass the this.formattedBookingPrice and this.formattedCheckingPrice values to a child component using the value array instead of static values, especially when they are inside the subscribe method? This is my parent component. expor ...

Height CSS does not conceal side bar hyperlinks

CSS .nested-menu { .list-group-item { cursor: pointer; } .nested { list-style-type: none; } ul.submenu { height: 0; } & .expand { ul.submenu { ...

Download personalized HTML design

Situation When exporting to HTML, the resulting code appears as follows: <html> <head> <title></title> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <style type="text/css" ...

PHP - Unable to store the input content

I've encountered an issue with my website where I need to create a form for users to submit new information or news. Below is the code snippet that I have: <?php include "0begin.php"; $title=$_POST["title"]; isset($title) or $title=$_GET["tit ...

Show a picture upon hovering the button

Welcome to my website. My goal: Show an image when a user hovers over the links. I must be making some silly error, but I can't pinpoint it. This is what I've attempted so far: HTML <ul class="nm"> <li><a href="#">Cork& ...

transferring background-image in html between elements

Imagine having a three-level hierarchy HTML code structured like this: <section> <div id="outer"> <div id="inner"> </div> </div> </section> If we set background-image:someImage.jpg to the section, and backg ...

Selection of multiple listings

Looking for a solution to create a multi list selection area? You can double click on an item in the left list to add it to the selected area. Also, you can double click on an item in the selected area to remove it from the list. <ul id="selection"> ...

Is there a way to process the output of phantom.js in PHP efficiently?

I have successfully retrieved output from a phantom.js request via the command line and it meets my expectations. Now, I am interested in invoking phantom.js from a php script and then analyzing the output for specific content. My phantom.js script appear ...

Tips for creating a button hover effect with dynamic color and opacity

On my webpage, the button color is determined by an admin using JavaScript on page load. Since I don't know what color will be used, I can't apply rgba(). While using opacity does change the button's color, it also affects the text, which is ...

Need help resolving an issue with an HTML header that's overlapping in JavaScript?

Hey there! I was working on implementing a dynamic header that resizes as you scroll on the page. I also decided to try out Headroom as an additional solution, and it seems to be functioning well in terms of hiding the header. You can check out my progress ...

What is the proper way to utilize the name, ref, and defaultValue parameters in a select-option element in React Meteor?

I recently developed a Meteor project using ReactJS. I have a Create/Edit page where I use the same input field for various form elements. Here is an example of code snippet that I currently have: <FormGroup> <ControlLabel>Province</Control ...

Yet another iteration of an SQL query within a loop for row querying

I am currently facing a coding dilemma as I work on creating a News Feed feature. The functionality of the news feed is satisfactory, but now I wish to enhance it by adding an avatar picture to each news row, representing the author. However, the path to ...