Trouble with a persistent footer on a webpage using HTML5 and CSS

Check out my code below:

<footer>

<div id="footer">
<div class="footer-column" id="footer_column1">
<nav class="footer-link">
<ul>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>

<li>Home</li>

<li>Home</li>

</ul>
</nav>
</div>
  <div class="footer-column" id="footer_column2"> 
<nav class="footer-link">
<ul>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>

<li>Home</li>

<li>Home</li>

</ul>
</nav>
</div>
  <div class="footer-column" id="footer_column3">
<nav class="footer-link">
<ul>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>

<li>Home</li>

<li>Home</li>

</ul>
</nav></div>
  <div class="footer-column" id="footer_column4">
<nav class="footer-link">
<ul>
<li>Home</li>
<li>Home</li>
<li>Home</li>
<li>Home</li>

<li>Home</li>

<li>Home</li>

</ul>
</nav>
</div>

</div>
</footer>

I have successfully implemented a sticky footer using HTML5 and CSS.

The CSS for the footer is as follows:

#footer {
   position:absolute;
   clear:both;
   bottom:0;
   color:#000;
   width:100%;
   height: 100px;
   background:#fff;
   margin-top:100px;
   left:0;

}
.footer-column {
  float: left; /* Push the div as far up-left as it can be put */
  width: 25%; /* Make sure to subtract the padding */
  padding: 10px; /* We want padding on all sides to make things look nice */
  text-align:center;
}

.footer-column .footer-link ul li
{
    list-style-type:none;
    display:block;
}

In addition, use the following CSS for wrapping: #wrap{width:100%;}. You can preview the updated page layout here.

If you're experiencing issues with setting the correct height for your sticky footer, feel free to ask for assistance!

Answer №1

Check out this link for more information.

Here is the relevant code snippet:

#main {overflow:auto;
    padding-bottom: 180px;}  /* Make sure it matches the height of the footer */

#footer {position: relative;
    margin-top: -180px; /* Negative value equivalent to footer height */
    height: 180px;
    clear:both;} 

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

Having trouble with your contact form sending messages?

Looking for some assistance with the Contact form on this Codepen page: https://codepen.io/ssbalakumar/pen/uzDIA The form is displaying correctly on my website, but when I try to submit it, the page reloads and I'm unsure where the message is being ...

Swap the image when hovering over it

Is it possible to modify this specific code so that a hover effect is triggered on mouseover? I attempted to look into similar questions and answers, but I found them difficult to understand. Here is the HTML snippet: <a href="RR.html"><img src ...

Unlocking the Possibilities of scroll-snap-type

My goal is to effectively utilize the scroll-snap-type property I'm struggling to understand why this code functions as intended html, body { scroll-snap-type: y mandatory; } .child { scroll-snap-align: start none; border: 3px dashed blac ...

jQuery Ajax Load() causing screen to refresh unintentionally upon clicking

I am currently developing a web application that includes side menus. However, I am facing an issue with the functionality of these menus. Whenever I click on certain options, the entire page refreshes. For example, under my main menu "Planning the Engagem ...

Presenting titles and buttons within a Bootstrap modal window

I have implemented a modal using vue-bootstrap. The code for the modal is as follows: <template id="child"> <b-modal v-model="showModal" size="lg"> <template v-slot:modal-header> <h4 class="modal-title"> ...

Strange problem with jquery/css animations when scrolling on the webpage

Here is the link to my page: The problem I am facing is that when the page initially loads, the animations do not work on most elements like the button below the video. However, when I scroll back up, the animations start working and then when I scroll do ...

Combining photos seamlessly and bringing them to life through animation upon window loading

My main goal is to seamlessly fit the images together, but I'm struggling to achieve this. I tried using masonry, but unfortunately it didn't work for me. All I want is to tightly pack the divs together. For instance, in my fiddle example, I woul ...

Is it possible to inject code into HTML using JQuery?

Despite having looked at numerous examples and being aware of the answer to my question, I can't help but feel like I might be missing something. I suspect that the reason this isn't working is because I am running this code locally, rather than ...

Illuminate the image upon checking the checkbox, as well as when clicking on the image itself

Issue with Implementation <div> <input type="checkbox" id="check" class="check-with-label" /> <label for="check" class="label-for-check">My Label <img class="product-add-image-preview" src="http://ecx.images-amazon.com/images ...

Attempting to place a different span beneath the current span

Is it possible to add another span below the first span and keep it on the same line as the circle? Check out this link for reference The following is the HTML code snippet: <div class="dialog-box"> <div class="dialog-box-circle"></d ...

How to implement bi-directional scroll animation in JavaScript for top and bottom movements

In my JS project, I experimented with creating animations using the bounding client feature. By scrolling down to reveal certain text or content, I was able to adjust its opacity to 1 by applying the CSS class ".active". However, once the user scrolls back ...

Unselecting a span in AngularJS: Switching selection to another span

Whenever I click on an item from my list displayed using ngrepeat, it generates another list specific to the selected element. My goal is to change the background color of the clicked element to indicate it has been selected. However, the problem arises wh ...

Complete a form when a link or button on the webpage is clicked

I have a variety of links and buttons on my webpage, and they are generated dynamically. I am unable to assign an onclick event to each one individually. My goal is to submit form data to the next page whenever any link or button on the page is clicked. ...

What is the best way to continuously execute the 'onclick' function using AJAX inside a specific ID?

My challenge involves implementing a new AJAX upload feature to insert a data element from the onClick event in multiple rows. The issue I am facing is that it works fine for the first row, but when I add subsequent rows, the function no longer works upon ...

Eliminate unnecessary padding in text elements

It's such a simple thing, but it's causing me a major headache: How can I get rid of the top and bottom margin that seems to be automatically added to HTML text components? <!DOCTYPE html> <html> <body> <h1 style=" ...

The panel's fullscreen feature crashes when exiting after triggering the 'resize' function

I'm facing an issue with a popup window that automatically goes into fullscreen mode. There are two buttons - one to exit fullscreen and another to simply close the window. When the window is in fullscreen, the exit button works perfectly. However, i ...

Is there a method to consistently keep the horizontal scrollbar in view for the MUI Data Grid at all times?

I have a Data table with virtualized columns, totaling more than 25 in number. Users can easily scroll horizontally using a trackpad, but without one, they may struggle to access all the columns due to the delayed appearance of the scrollbar. Is there a w ...

Guide on implementing Observables in Angular 2+ to update a single entry in a table in real-time

I'm facing a challenge with my Angular4 and Node.js application. I have a table that displays data with 7 columns using *ngFor. The issue arises when I need to update the last column dynamically and in real-time. Specifically, I want to show a green c ...

The Complete Definition of HTML in Technical Terms

I would like to delve deeper into the technical definition of HTML. Although I am aware that HTML stands for HyperText Markup Language, I am still unclear on the precise technical implications of these terms. Can you explain what HyperText means? What ...

Tips for adjusting image and div sizes dynamically according to the window size

In my quest, the end goal is to craft a simplistic gallery that closely resembles this particular example: EXAMPLE: This sample gallery is created using Flash technology, but I aim to develop mine utilizing HTML, CSS & Javascript to ensure compatibil ...