The location of the footer is not aligned correctly

Recently, I encountered an issue that has left me puzzled. The problem is that the footer on my webpage is appearing between the calendar button and the calendar itself.

Here is a snippet from my calendar.html file:

{% extends 'base.html' %}

{% block title %}
Calendar
{% endblock %}

{% block content %}
<div class="clearfix">
    <a class="btn btn-info left" href="{% url 'cal:calendar' %}?{{ prev_month }}"> Previous Month </a>
    <a class="btn btn-info right" href="{% url 'cal:calendar' %}?{{ next_month }}"> Next Month </a>
    <a class="btn btn-info right" href="{% url 'cal:event_new' %}"> New Imputation </a>
</div>
{{calendar}}
{% endblock %}

Snippet from base.html:

<div class="wrapper">

{% include "header.html" %}

{% include "menu.html" %}

<div class="content-wrapper">
    <section class="content-header">
      {% block title_page %}{% endblock %}
    </section>
    <section class="content container-fluid">
        {% block content %}       
        {% endblock %}       
    </section>     
</div>
{% include "footer.html" %}
</div>

And here's a snippet from the views.py file for the calendar view:

Views.py:

@method_decorator(login_required(login_url='/userprofile/login/'), name='dispatch')
class CalendarView(generic.ListView):
    model = Event
    template_name = 'cal/calendar.html'

    def get_context_data(self, **kwargs):
        context = super().get_context_data(**kwargs)
        d = get_date(self.request.GET.get('month', None))
        cal = Calendar(d.year, d.month)
        html_cal = cal.formatmonth(withyear=True)
        context['calendar'] = mark_safe(html_cal)
        context['prev_month'] = prev_month(d)
        context['next_month'] = next_month(d)
        return context

Upon inspection with F12, I noticed that the footer is breaking the layout:

<div class="clearfix">
    <a class="btn btn-info left" href="/calendrier/calendar/?month=2020-6"> Previous Month </a>
    <a class="btn btn-info right" href="/calendrier/calendar/?month=2020-8"> Next Month </a>
    <a class="btn btn-info right" href="/calendrier/event/new/"> New Imputation </a>
</div>
<footer class="main-footer">    
    <div class="pull-right hidden-xs">
        Version X.x
    </div>
    <strong>Copyright © 2019 <a href="#">CONDUENT</a>.</strong> All rights reserved.
    
    </footer><div>
  
</div><table border="1" cellpadding="1" cellspacing="1" class="calendar">

The footer seems to be out of place according to the structure of the page. Let me know if you need to take a look at the CSS or if there are other details needed to address this issue.

My main focus is to have the footer back in its correct position :c

Answer №1

Make sure to specify the endings of the blocks

Callendar.html :

{% extends 'base.html' %}

{% block title_page %}
Calendar
{% endblock title_page %}

{% block content %}
<div class="clearfix">
    <a class="btn btn-info left" href="{% url 'cal:calendar' %}?{{ prev_month }}"> Previous Month </a>
    <a class="btn btn-info right" href="{% url 'cal:calendar' %}?{{ next_month }}"> Next Month </a>
    <a class="btn btn-info right" href="{% url 'cal:event_new' %}"> New Imputation </a>
</div>
{{calendar}}
{% endblock content %}

base.html :

<div class="wrapper">

{% include "header.html" %}

{% include "menu.html" %}

<div class="content-wrapper">
    <section class="content-header">
      {% block title_page %}{% endblock title_page %}
    </section>
    <section class="content container-fluid">
        {% block content %}       
        {% endblock content %}       
    </section>     
</div>
{% include "footer.html" %}
</div>

also remember to do the same thing for your "menu.html", "header.html" and "footer.html"

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

Looking for assistance in streamlining my jQuery code for bootstrap tab pane. Any takers?

Having trouble setting a specific tab as active when navigating from different links. I have found a solution, but it involves writing code for each individual tab. Can someone offer assistance in simplifying the code? <table class="nav nav-tabs"> ...

Tips for creating a stylish, blurred, and centered box for a login form on a full-size background that is also responsive

I attempted to create a login form on an HTML page using Angular, featuring a full-size background image that is centered. The form itself is contained within a div with a blurred background, also centered both horizontally and vertically within the browse ...

How can you check if a field is blank without allowing any empty spaces to be saved in JavaScript?

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <html> <body> <form id="api_crud_form" name="api_crud_form" action="https://www.google.es"> Name: <input type="text" name="name" id=" ...

Place a single div above two divs in a flexbox container

I am struggling with aligning the fourth div, which has a class of "details", above the second and third div in a flex box layout. Despite my efforts, I have not been successful in achieving this alignment. Can someone please assist me? .flex-container ...

Trigger the fire event on .click() except when text is being selected

I am currently working on a chat box project and I want the input field within the message area to automatically get focused when the user clicks anywhere in the chat box. However, I don't want this functionality to interfere with text selection for c ...

Unable to show an image within the <div> element when hovering the mouse

Is it necessary to use the background style image in order to display an image on mouseover of a name? I have implemented a controller and would like the image to be replaced by text within a div tag. Below is my HTML code: <!DOCTYPE html> <html& ...

Is it feasible to display a message for a certain duration without using the alert() function upon clicking a button?

I'm working on a NEXT.JS project and I need to display a <p> element under my button for a specific duration before it disappears. I don't want to use the alert() function. Any suggestions on how to achieve this? ...

Attach a floating div to multiple elements throughout a webpage

Looking for the optimal method to place a div in various locations on a webpage while anchoring it from the bottom left. The div should be able to be attached to any element on the page for relative positioning, specifically intended for a tooltip. Each ...

Creating a Comprehensive Page Design with Bootstrap and the Latest Version of Vue

My goal is to develop a Single Page Application using Vue3 and the Bootstrap 5 framework with a simple layout of Header -> Content -> Footer. I want the Content section to fill the space between the header and footer, ensuring there is no overlap. Ho ...

What is the best method for incorporating a YouTube embedded video into an image carousel using HTML and CSS?

I'm encountering an issue with my product carousel that includes an image and a video. The image displays correctly, but when I attempt to click on the video to have it appear in the main carousel view, it doesn't function as expected. Here is a ...

Loading background images in CSS before Nivo slider starts causing a problem

I've been struggling with preloading the background image of my wrapper before the nivo-slider slideshow loads. Despite it being just a fraction of a second delay, my client is quite particular about it -_- After attempting various jQuery and CSS tec ...

Transferring the dirty state of the view to the parent form

Within my main form's markup, there is a specific structure that includes a tabset and a selectView method in the controller: <tabset vertical="true" type="pills"> <tab ng-repeat="tab in tabsViews" sele ...

Focusing solely on a particular category in EJS

I am struggling with this code snippet. HTML: <header<% if ( current.source === 'features' || current.path[0] === 'index' || current.source !== 'customers' ) { %> class="header-white"<% } %>> <div cl ...

Concealing a CSS element within another one

Hey there, I've got a little issue I could use some help with. So, I've created a progress bar for my portfolio website, but there's a small hiccup. The #ability div is causing some trouble - when I adjust the width property to 1%-3%, it e ...

I incorporated a YouTube video using the iframe tag, but encountered an issue where the page would not scroll up or down when the mouse cursor was positioned on the iframe

How would you like your HTML code to function? When the cursor is on the iframe, do you want it to play a video? Also, should the parent page scroll when you scroll? <section class="section section-padding"> <div class="container"> ...

Having trouble with Safari on your iPhone? Seeing image outlines peeking through radius borders?

Has anyone encountered a similar issue before? I'm experiencing this problem specifically on Safari for iPhone. Problem: https://i.sstatic.net/ffqWz.jpg Solution: https://i.sstatic.net/z1bUB.png Below is the HTML code snippet: <div class="row"& ...

What is the best way to extract a color box from a Bootstrap container?

After trying multiple solutions found online, I'm still struggling to break out of the bootstrap container as needed. The setup involves a .fluid-container for a full-width background behind a regular .container. The challenge arises when the first co ...

Utilizing CSS for a responsive background image

While constructing a website, I encountered an issue where the client is using a mobile device and I want to prevent them from loading a particular background image. For larger screens, my plan is to incorporate approximately 5 images with different resolu ...

Positioning elements next to each other in jQuery on mouse over - while also addressing scrolling issues in a div

After tinkering with this interesting concept of mouseover combined with absolute positioning divs on a jsFiddle, I encountered some unexpected results. The code was inspired by a stackoverflow thread on positioning one element relative to another using j ...

Choosing an element within a table following a different element using Selenium

On a webpage, a table displays various plain text elements (filenames) on the left side and hyperlinks to PDF files on the right: Red report Download PDF Blue report Download PDF Green report Download PDF These pages have multiple entries, and t ...