Struggling to properly center the footer on my Django template

I'm currently facing an issue when attempting to align my footer in the center of my Django template. The specific class for the footer is Pagination.

Base HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8">
        <title>Flickr Photobrowser</title>
        <style>
        html, body {
            height: 100%;
        }
        * {
            margin: 0;
            padding: 0;
        }
        #wrap {
            min-height:100%;
        }
        #header {
            background: #111;
            color: white;
        }
        #header, #content {
            padding: 10px 150px 10px 150px;
        } 
        #content {
            overflow:auto;
            padding-bottom: 150px;  
        }
        pagination {
            position: relative;
            margin-top: -150px; 
            height: 150px;
            text-align: center;
        } 
        h1 {
            font-family: Georgia;
            font-weight: 100;
            font-style: italic;
            font-size: 30px;
            padding-top: 50px;
        }
        h2 {
            font-size:20px;
            margin-top: 5px;
            color: #ff0080;
            margin-bottom: 5px;
        }
        #image {
            float:left;
            padding: 2px;
        }
        .thumbnail {
            position: relative;
            z-index: 0;
        }
        .thumbnail:hover {
            background-color: transparent;
            z-index: 50;
        }
        .thumbnail span { 
            position: absolute;
            background-color: lightyellow;
            padding: 5px;
            left: -1000px;
            border: 1px solid #000000;
            visibility: hidden;
            color: black;
            text-decoration: none;
        }
        .thumbnail span img { 
            border-width: 0;
            padding: 2px;
        }
        .thumbnail:hover span { 
            visibility: visible;
            margin-left: auto;
            margin-right: auto;
            top: 0;
            left: 10px; 
        }

        </style>
    </head>

    <body>
        <div id="wrap">
            <div id="header"><h1>Flickr Photobrowser</h1></div>
            <div id="content">
            {% block content %}
                <h2>Welcome!</h2>
                <p>This sample application demonstrates how to authenticate against Twitter using their oAuth API.<br>Click below to begin authentication:</p>
                <p><a class="auth" href="auth/">Authenticate »</a></p>
            {% endblock %}
            </div>

        </div>
        {% block footer %}
        {% endblock %}
    </body>

</html>

Actual Page HTML:

{% extends "base.html" %}

{% block content %}
<form method="get" action="../photouser/">
Flickr username: <input type="text" name="username"> 
<input type="submit" value="submit">
</form>
<p>Search by <a href="../phototags/">tags</a>?</p>
<p><h2>Displaying photos for {{ username }}</h2></p>
<ul>
{% for photosmall, photobig, actualimage in photopages.object_list %}
<div id="image"><a class="thumbnail" href="{{ actualimage }}">
<img src="{{ photosmall }}"/><span><img src="{{ photobig }}"/></span>
</a></div>
{% endfor %}
</ul>

{% endblock %}

{% block footer %}
<div class="pagination">
    <span class="step-links">
        {% if photopages.has_previous %}
            <a href="?username={{ username }}&page={{ photopages.previous_page_number }}">Previous</a>
        {% endif %}

        <span class="current">
            Page {{ photopages.number }} of {{ photopages.paginator.num_pages }}
        </span>

        {% if photopages.has_next %}
            <a href="?username={{ username }}&page={{ photopages.next_page_number }}">Next</a>
        {% endif %}
    </span>
</div>
{% endblock %}

Answer №1

Seems like the only issue here is a small typo.

Your CSS code currently targets an element called <pagination>, but you actually have:

<div class="pagination">

To fix this, simply update your CSS selector to:

.pagination 

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

Determine the specific cell involved in an HTML5 drag-and-drop interaction within a table

I've been experimenting with the HTML5 drag and drop functionality in an Angular project. Here's the setup I'm working with: A container containing draggable 'objects' A table where users can drop the dragged elements Following ...

Running a Python script locally within a Django project that is hosted on AWS: A step-by-step guide

I am in need of executing a Python script locally with arguments on a Windows computer. The python code is hosted on AWS and needs to trigger the local script. ...

The ngbDatepicker within the Bootstrap angular framework is designed to seamlessly integrate with ngbPanelContent without causing overflow issues

I've integrated the ngbDatepicker into a form as shown below <ngb-panel> <ng-template ngbPanelTitle> <div class="row"> <ui-switch (change)="onChange($event,2)" [checked]="profession ...

Which is the ideal library for creating this specific chart - shown in the image in the description - in reactjs?

After numerous unsuccessful attempts, I have finally decided to seek help in creating this chart. I would highly appreciate any assistance that can be provided. ...

What steps can I take to verify that all textboxes are filled and checkboxes are selected before allowing the user to submit the form?

Here is the JavaScript code and a snippet of the HTML that I am using to create a form. I am having trouble figuring out why the form can still be submitted even when there are empty fields. Ideally, a dialog box should pop up indicating which fields nee ...

What is the best way to incorporate an input bar in a Bootstrap panel header?

When designing a search box in my panel header, I floated both elements to get them onto the same line. Although functional, the vertical alignment of the title is displeasing and I am seeking a way to improve this without drastically changing its size. I ...

css determining the width through calculation

I am facing a challenge with a math problem. My content box is 700 pixels wide, and my hentry (inside content) is 100% wide with padding of 10 pixels. This causes the hentry to be wider than the content, resulting in an overflow... Does anyone have a so ...

Web pages that dynamically update without the need for reloading

Recently, I stumbled upon slack.com and was immediately captivated by its user interface. For those unfamiliar with it, navigating the site is quite simple: There's a sidebar on the left and a main content area on the right. When you click on an item ...

Incorporating the <sub> element while maintaining the line height

I am facing a challenge with formatting text that includes subscripts and superscripts tags. For example: <div>hello <sub>world</sub>, how are you? Translated as logical aggregates or associative compounds, these characters have been int ...

Issues with the navigation and logo design in bootstrap mode

1: How can I adjust the size of the logo and name in my Bootstrap navigation? 2: My navigation menu is not showing up correctly. Can anyone help me troubleshoot? Navbar: <nav class="navbar navbar-expand-lg py-4 fig-nav"> <div class=&q ...

Loading Bootstrap Modal with click event triggering

I am currently working on a project where I need to load ajax content into a bootstrap modal when a link is clicked. I have been able to successfully load the content without any issues, but I am facing some difficulties triggering the modal window to open ...

Check if the element is located on the active tab using jQuery

I have implemented a tab system to organize a lengthy form with multiple input fields. The form consists of 4 tabs, and beneath them, there is a preview section displaying the user's selections. In this preview area, I added icons that enable users ...

Creating a circular image in a responsive navigation bar

Currently, I have a chat navigation bar with divs representing different users, each displaying a photo of the user. My goal is to have these photos displayed as perfect circles. To achieve this, I am using padding-bottom and width properties. However, I a ...

Tips for extracting an XML value from an API

I'm attempting to showcase a value retrieved from an API (specifically used by PRTG software to extract information). Here is the link to the API: The API provides an XML file structured like this: <?xml version="1.0" encoding="UTF-8"?> <ch ...

Mathematics - Determined the dimensions of an adjusted image size

Currently, I am implementing a basic mathematical method to crop an image. My approach involves utilizing the jQuery plugin called imageareaselect.js to overlay an adjustable layer on top of an image. By resizing this layer with the cursor and clicking a b ...

What is the best way to align a form in the center of a page both horizontally and vertically

Currently, this is the HTML code I am working with: <body> <form id="form_login"> <p> <input type="text" id="username" placeholder="username" /> </p> ...

Explore registrations by year and month

I am currently working on coding where a record needs to be displayed based on the date (Month, Year), for instance: 12-2022. However, with the current code I have, I am unable to achieve this. Can anyone offer some guidance on what steps I should take? ...

Is there a way to streamline the form completion process on my website by utilizing voice commands through the user's microphone?

My webpage features a web form using Flask where users manually input their information that is then added to a table upon submitting. The current setup involves an autoplay video prompting users with questions, which they answer manually and then submit t ...

Create a small circle in the bottom left corner with a constrained size

I'm trying to create a circle at the top of the screen on mobile, similar to the image below. The circle should take up a percentage of space, with the rest of the content appearing against a blue background as shown in the image. However, I'm h ...

Is it possible to dynamically pass a component to a generic component in React?

Currently using Angular2+ and in need of passing a content component to a generic modal component. Which Component Should Pass the Content Component? openModal() { // open the modal component const modalRef = this.modalService.open(NgbdModalCompo ...