Footer rises with bootstrap zooming

Hey everyone! I'm a beginner in the world of web development and currently working on creating my own website. I've run into an issue with my footer - I want it to stay fixed at the bottom even when zoomed in, but for some reason, when I zoom in, the footer moves up as shown in the screenshot below. I've tried searching for a solution online but haven't been able to find one. Can anyone help me out? SCREENSHOT ALL CODE:

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

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    ...
    ... (code continues)
    ...
</style>

</html>

HTML:

<footer class="page-footer font-small blue pt-4">
        <div class="container-fluid text-center text-md-left">
            <div class="row">
                <div class="col-md-6 mt-md-0 mt-3">
                    <h4 class="text-uppercase"><b>About</b></h4>
                    <p>Bright World is a multinational corporation headquartered<br>in Pakistan, one of the largest
                        electronics companies in the<br>world, currently focused in the area of lighting. It
                        was<br>founded in  by Gerard Mark and his father<br>Frederik, with their
                        first products being light bulbs.</p>
                ...
                ... (code continues)
                ...
        <div class="footer-copyright text-center py-3">© Copyright 2021 BrightWorld
        </div>
    </footer>

CSS:

.page-footer {
        background-color: #1B1B1B;
        color: white;
        position: relative;
    }
    .footer-copyright {
        background-color: #090909;
        color: white;
    }
    ...
    ... (css code continues)
    ...

Before zooming in chrome: https://i.sstatic.net/7xmgE.jpg After zooming in 125% in chrome: https://i.sstatic.net/fuqNb.jpg

Answer №1

To ensure correct sizing, it is important to verify the height of both the header and footer before making any adjustments.

Here are the steps to follow in order to check the height:

  • Inspect the element on the tag and hover over the footer tag to determine if the height matches that of the following tag.

https://i.sstatic.net/AAMIK.jpg

.content-area {
    height: cal(100vh - 413px);
}

remove: 

body {
    height: calc(100vh - 100px);
}
<section class="content-area">
    <div class="container">
        {% block content %}{% endblock %}
    </div>
</section>

replace with

<div class="container">
        {% block content %}{% endblock %}
    </div>

Answer №2

If you want to keep the footer at the bottom, follow these steps: Remove the '<br>' tag before the container div and add the full-height class to the container div.

<div class="container full-height">
   {% block content %}{% endblock %}
</div>

Next, remove this styling:

body {
    height: calc(100vh - 100px);
}

Replace it with this styling:

.container.full-height {
    height: calc(100vh - 413px);
 }

The value of 413px comes from the total height of the header and footer sections.

For reference, here is the JSFiddle link: https://jsfiddle.net/yudizsolutions/9f2vy3wr/5/
I hope this explanation helps!

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

Learn the process of sending notifications upon clicking on an advertisement by a user

I'm currently working on a system that displays ads on mobile devices. Our clients have the option to use their own custom HTML code for their advertisements. We want to be able to track when a user clicks on these ads. I am considering wrapping the u ...

Error: Property '$filter' is not defined and cannot be read

Whenever a user clicks on a link, I display the json object on the UI. However, an exception is being thrown with the following message: TypeError: Cannot read property '$filter' of undefined Check out the demo here: http://plnkr.co/edit/5NOBQ3 ...

Altering the "src" property of the <script> tag

Can the "src" attribute of a current <script> element be altered using Jquery.attr()? I believed it would be an easy method to enable JSONP functionality, however, I am encountering difficulties in making it operate effectively. ...

Tips for incorporating a value within the AngularJS select function

Having an issue with passing a list value in the html select method using AngularJS. Here is my code: app.js $scope.subcategory = function() { var query = "SELECT unit FROM Length;"; $cordovaSQLite.execute(db, query).then(function(res) { ...

Adding the !important rule in React inline CSS effortlessly

Is there a way to include !important in my inline CSS property without disrupting the entire style? import React from "react"; export default class Todo extends React.Component { render() { const {text} = this.props; const cardStyl ...

including information inputted into a form into a data-storage system

I have set up a webform for users to request access to my CV. After submission, I aim to save their details in a phpMyAdmin database. As a PHP beginner handling databases within an HTML file, I received some code that needed modifications to fit my form fi ...

Attempting to showcase JSON response within an HTML page using JavaScript

Can anyone help me troubleshoot my code for displaying JSON data on a web page? Here's what I have so far: <button type="submit" onclick="javascript:send()">call</button> <div id="div"></div> <script type="text/javascript ...

Using Angular with Bootstrap to implement a typeahead feature

I've been working on getting my Typeahead feature to function properly: <div *ngFor="let item of items; index as i"> <input type="text" name="name{{i}}" [(ngModel)]="item.name" [ngbTypeahead]="searchItem" /> </div> Within the c ...

Does CSS media query "@media only screen" only work when I am resizing the window?

I recently encountered an issue with the code found on this website (the repository can be viewed on Github here): @media only screen and (max-width: 600px) { img {width: 100%; height: 100%; margin: 0; padding: 0; } a.box { width: 100%; pa ...

issues with the functionality of bootstrap modal

I'm currently working on a project where I need to set up a modal popup using bootstrap. The website I'm working on is organized by departments, so the only part of the code that I have control over is the main body of the site. I have included t ...

Having trouble with the Bootstrap 5 modal in the initial template?

I'm encountering an issue with setting up a basic modal using the Bootstrap 5 starter template paired with the Bootstrap Bundle including Popper. Despite reviewing similar problems on other platforms, none of the solutions seem to resolve my specific ...

Is there a way to create a marker that changes color when hovering over the text directly below it?

Hi everyone, I hope you're all doing well. Currently, if you hover over the marker, it changes color. However, I want this effect to apply when hovering over the text below as well. Is there a way to create a connection between these two div elements? ...

Increment counter when a key is pressed in Angular 4 and decrement when the backspace key is pressed

As a beginner in Angular, my goal is to create a feature where: The character count in a label increases as text is entered into a textarea. When the backspace key is pressed, the counter should decrease. If the user attempts to enter more characters tha ...

Unique styling implementation for element situated underneath Angular 6 router-outlet

I'm currently working on implementing router transitions in my Angular application, and I've encountered an unusual problem. The styling for the router-outlet element is being applied to the element that comes after it in the DOM hierarchy. Here ...

Scrolling problems with numerous bootstrap modals on a Webpage

I am faced with an issue on a page where I have set the property overflow: auto. This page features a hyperlink to open the first modal, and within the first modal, there is a link to the second modal. My steps are as follows: Open Page 1 Click on the l ...

The fundamental principle of starting with mobile design in Bootstrap

I'm struggling to understand the concept of "mobile first default behavior" in Bootstrap 3. If there is no breakpoint at 480px, how can Extra small devices be the default? I get that it applies to font sizes, but what about the grid system? How can I ...

How can a single item from each row be chosen by selecting the last item in the list with the radio button?

How can I ensure that only one item is selected from each row in the list when using radio buttons? <?php $i = 1; ?> @foreach ($products as $product) <tr> <td scope="row">{{ $i++ }}</td> <td>{{ ...

Populating a dropdown list with options

When selecting a value from the first dropdown list, a MySQL query is used to return data which should populate the second dropdown list. However, there seems to be an issue with the second list not getting populated, even though the code appears to work f ...

How can you extract information from a text document and seamlessly incorporate it into an HTML webpage?

I am currently working with an HTML file structured like this.. <html> <body> <table border="1" cellpadding="5"> <tr> <td>Some Fixed text here</td> <td id="data">---here data as per values in external text file--- ...

Obtain data using a REST request from a webpage or web server

Is it possible to extract the last status value from a delivery courier's webpage by sending a tracking number request using PHP? I have found some helpful information, but I am unsure if it is possible to extract only specific values from the result ...