The footer extends all the way down the page

I am facing an issue with the footer on my website. When the list of items is empty, the footer extends all the way up to the navigation bar itself. I attempted to find a workaround, but as I am not a front-end developer, my efforts were unsuccessful. I am using Bootstrap 4 and have a custom class called .page-footer.

Here is the CSS code:

.page-footer {
  padding: 2.5rem 0;
  color: #999;
  text-align: center;
  border-top: .05rem solid #e5e5e5;
}

And here is the HTML code:

    {% block footer %}
    <footer class="page-footer">

      -- Code snippet truncated for brevity --

    </footer>
    {% endblock footer %}

The entire HTML page code can be seen below:

<!DOCTYPE html>
<html lang="en">

{% block header %}
  <head>

    <!-- Bootstrap core CSS -->
    <link href="{% static 'vendor/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">


  -- Code snippet truncated for brevity --

</html>

Answer №1

When you mention:

the footer almost reaching the navigation bar

...and it seems like the issue is that your footer doesn't always stay at the bottom of the screen and gets too close to your nav menu.

Your problem might not actually be with the footer itself, and there are a few ways you can tackle this depending on what you want to achieve.

One option is to include

  position:absolute;
  width: 100%;
  bottom:0;

...to the footer, similar to how I've done in This codepen.

You can also explore other solutions provided in previous answers like this one.

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

Tips on creating a responsive shopping cart and favorites button

My Bootstrap navbar includes a shopping cart and favorites button. However, when the screen size hits 992px, the navbar switches to a hamburger collapse menu. This causes the cart and favorites buttons to spread out awkwardly. I need assistance in displayi ...

Resizing buttons in Ionic 2 using columns

I have a simple challenge to tackle, I am seeking a way for my buttons to occupy 90% of the width of my columns in Ionic 2, regardless of the text content. .button-pink { color: #F63566; background-color: white; text-transform: uppercase; ...

Modifying linked dropdown selections with jQuery

I'm trying to create a recurrent functionality where I have 3 select elements. When the first select is changed, it should update the second and third selects accordingly. If the second select is changed, then it should also affect the third select. ...

Initial collapse issue with Bootstrap accordion upon page load

Check out the HTML view below: $('.collapse').on('shown.bs.collapse', function(){ $(this).parent().find(".fa-chevron-right").removeClass("fa-chevron-right").addClass("fa-chevron-up"); }).on('hidden.bs.collapse', fun ...

Tips for avoiding my photobanner from being truncated on a webpage and ensuring there is an automatic scrollbar

My website used to have photobanners displayed horizontally with the ability to scroll through them, but after accidentally deleting some code, I realized that now the images are cut off at the edge of the webpage without a scrollbar. How can I restore the ...

Ways to create a full-window image cover starting from the center point and extending to the right by 50

Seeking assistance from anyone who can help me with my current issue. I am currently utilizing bootsrap 4 and I need to come up with a solution for the following scenario: I have one element that is situated within the standard six columns, while the secon ...

The font-weight attribute seems to be malfunctioning in this particular scenario

Take a look at the CSS I've been working on: td{ color: white; font-family: arial; font-size: 13vh; font-weight: 300; text-align: center; vertical-align: middle; background-color: rgba(4,54,82, ...

Can you choose the class that has not yet been seen before?

Imagine a scenario where the following code is present: <div class="a"> <div>1</div> <div>2</div> <div> <div> <div class="b">3</div> </div> ...

The sidebar in Semantic UI does not have a specified height for the form segment

Need help troubleshooting a button that slides out a vertical sidebar. I want to include a short form for users to input search queries within the sidebar. The issue seems to be with the heights of #search-sidebar and .ui.form.segment. Here is the code s ...

The function of modal in JavaScript is not working properly

I am encountering a problem with my web page that is running on Wildfly 12. It is a simple Java EE project that I developed in Eclipse Neon. The issue arises when I try to use Bootstrap modals, as every time I attempt to open or use the methods in a JavaSc ...

What is the purpose of using colspan in CSS?

I'm attempting to rearrange a table layout from its current form: https://i.sstatic.net/fVgz6.png to look like this: https://i.sstatic.net/cYXGD.png using only CSS. The rationale behind this is the abundance of space available on desktop compared ...

How can I stop the space bar from activating its default action unless I am inside an input field

If we want to stop the default scrolling behavior when pressing the space bar on the document, we can use the following code snippet: $(document).keypress(function(event) { event.preventDefault(); }); However, this approach won't work if there ar ...

Steps for creating a div element on top of an image

<div style="border-style:solid; margin:auto;"> <div style="position:absolute;"> <div style="background:yellow; border-style:dotted; height:300px; width:300px"> <h3>THIS IS THE BODY, AND HEIGHT WILL BE CHANGED DYNAMICA ...

Trouble with CSS styling in Asp.Net MVC dropdown list

I have encountered an issue while trying to apply a CSS class to an ASP.NET MVC dropdown list. The CSS class works fine for the EditorFor case, but not for the DropDownListFor case. I am wondering what could be missing from my code? Here is the working CS ...

What is preventing me from directly taking from Codepen?

Looking to experiment with a different landing page? Take inspiration from this example. Here's the HTML snippet, for more details check out the full code on Codepen. <link href='http://fonts.googleapis.com/css?family=Lobster' rel=&apos ...

Request for a unique identifier generating an array of all IDs in .NET Core MVC

While looping through my model to create a table, I encountered an issue with my delete function. Instead of returning the singular clicked item ID upon deletion, it is giving me back an array of all IDs. <tbody id="itemTable"> ...

Top strategy for incorporating text into a logo design

My goal is to create a logo similar to the image below, with the black rectangle as an image and the text as real text. I have tried the code below (also available on jsfiddle http://jsfiddle.net/ueZ2H/ and it seems to be working. However, I am unsure if t ...

How can I incorporate a personalized SVG path to serve as a cursor on a webpage?

Is there a way to enhance the functionality of binding the 'mousemove' event to a div and moving it around the page while hiding the real cursor? Specifically, can we change the shape of the circle to an SVG path and drag the SVG path around the ...

How can I modify the font size of h1 and h2 elements in CSS?

I am currently working with a WordPress twenty eleven theme and I am trying to adjust the size of my headings. Specifically, when I enclose my headings in h1 and h2 tags like so: <h1>My h1 heading </h1> <h2> My h2 heading </h2> The ...

A Guide to Retrieving ngCordova Camera Images Using JavaScript

Currently in the process of developing a photo-editing application using the Ionic Framework. Initially, I integrated an open-source JS Drag & Drop photo editor and made necessary modifications. However, my challenge lies in accessing the image created by ...