Hidden footer error has been resolved despite background visibility

Greetings! This marks my debut post on this platform.

I've encountered a minor setback with the current website project I am working on. As I have implemented a CSS parallax header, I aimed to create a distinctive footer as well.

The concept was to affix it at the bottom and let the body gradually reveal the footer base first. However, an issue arose where the footer appeared between multiple segments of the site.

To address this concern, I attempted to insert a background between the segments using the following code:

.background { 
 color: #f1f1f1; 
 width: 100%; 
 height: 90%; 
 z-index: -2;
}

Describing my footer, here is the structure:

.footer {
    padding: 40px 0;
    text-align: center;
    text-decoration: none;
    background: black;
    color: #white;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: -1;
}

Regardless of any z-index value I experiment with, the footer either remains completely in the background or overshadows everything else.

At present, I'm uncertain about other potential methods to explore.

Below is a snippet of my (abbreviated) HTML body (preceded only by the header and a navigation bar):

<div class="main">
    <div class="row">
        <div class="leftcolumn">

            <div class="card">
                <h1><?php echo $welcome1;?></h1>
                <h5><?php echo $post;?></h5>
                <p><?php echo $welcome2;?></p>
            </div>

            <div class="card">
                <h2>Hiragana</h2>
                <h5><?php echo $post;?></h5>
                <img src="..//nihongo/pics/hiragana.png" width="650px" height="400px">
                <p><?php echo $hira;?></p>
            </div>

            <div class="card">
                <h2>Katakana</h2>
                <h5><?php echo $post;?></h5>
                <img src="..//nihongo/pics/katakana.png" width="650px" height="400px">
                <p><?php echo $kata;?></p>
            </div>
        </div>

        <div class="rightcolumn">

            <?php include '../nihongo/php/language.php'; ?>

            <div class="card">
                <h2><?php echo $me1;?></h2>
                <img src="../nihongo/pics/me.png" width="240px" height="322px" style="border: 1px solid black;border-radius:10px;">
                <p><?php echo $me2;?></p>
            </div>

            <div class="card">
                <h3><?php echo $use;?></h3>
                <div class="fakeimg"><p>Hiragana</p></div><br/>
                <div class="fakeimg"><p>Katakana</p></div><br/>
                <div class="fakeimg"><p>Kanji</p></div><br/>
            </div>

            <?php include '../nihongo/php/follow.php';?>

        </div>
    </div>
  </div>

    <?php include '../nihongo/php/footer.php';?>

</body>

Given that my website supports various languages, I utilize PHP variables extensively throughout its content.

For your reference, here's a screenshot demonstrating the problem without my attempted solution:

https://i.sstatic.net/hXeNU.png

If necessary, I can provide additional sections of my code upon request. Just specify which components you are interested in reviewing (to avoid unnecessarily long posts).

Answer №1

To ensure the footer only appears once .main is fully scrolled, consider setting a white background for .main and incorporating a margin-bottom equal to the footer's height. This will create space at the bottom of .main where the footer will eventually show as the content is scrolled.

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

Converted my Flask code into a specialized software package, encountering a perplexing TemplotNotFound error

After reorganizing my Flask code into a Python package structure, I am facing an issue where none of the HTML templates can be found when I run the code. Let me outline the simplified structure of my current Flask package. The run.py file is responsible f ...

The Bootstrap button is having trouble rendering correctly

I attempted to incorporate a Bootstrap search box in my code, expecting it to display like this: https://i.sstatic.net/bPNsE.jpg However, for some reason, it is not rendering correctly within my layout, which resembles this: https://i.sstatic.net/x3wyk.jp ...

Show a table containing dynamic information, featuring 10 rows for each column. The header should be present for each additional column that is added

I have incoming dynamic data that I need to display in columns, with 10 records in each row. Currently, I am able to display 10 rows as expected. However, I want the header to repeat each time an additional column is added. How can I achieve this using the ...

Learn how to dynamically remove HTML elements using jQuery, even when other elements are being removed simultaneously

I am currently working with the following HTML code: <div class="container"> <section> <header class="date">May 2014</header> <article>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus, d ...

Move a div to line up with a table row when clicked using jQuery

As I mentioned in a previous post, my experience with jQuery is limited and I apologize for that. The task I am attempting to accomplish seems relatively straightforward. Here's an overview of the situation: I have a table enclosed within a div. Each ...

Tips for updating the input name in Vue.js

I need assistance with implementing a dynamic form where input names must be in array format and the array number should increase automatically for posting purposes. Here is my code snippet: <!doctype html> <html lang="{{ str_replace('_&apo ...

What is the best way to ensure that my Material UI container occupies the entire width and height of the

Struggling to fit my content within a Material UI container in a React project, but it's creating odd margins. Check out the current look: https://i.stack.imgur.com/TaQs2.png Here's how I want it to display with full width: https://i.stack.imgur ...

What is the best way to adjust a map to completely fill the screen?

I am experiencing an issue with my Openlayer map not fitting to full screen automatically. Despite trying various settings, I am unable to resolve this issue. Can anyone suggest what might be causing this problem? Thank you in advance https://i.stack.imgu ...

Showing ASP code within a DIV element (inline)

Working on setting up a 'shopping cart' feature on our website, but running into some issues with the ASP code. Does anyone have any advice to offer? In the image below, you can see that when items are added to the cart, the 'total' is ...

CSS files are failing to load in ASP .NET framework

I am facing a similar issue to the one described by another user on Stack Overflow here: Asp.NET not applying my CSS files However, after adding the following code to my web.config file, nothing seems to change: <location path="css"> &l ...

How can I display two slides at once in Ionic 2/3 on a wide screen?

I have been searching for a solution that will allow me to display 1 ion-slide if the device screen is small, but if it's larger, then I want to display 2 ion-slides. Unfortunately, I have not been able to find a suitable solution yet. As an example, ...

Signs that indicate you have reached the bottom of the page

Wondering how they achieve that cool effect on where the top line appears with a new logo when you scroll down? Is it done using a jQuery trick? How can you determine when a person has scrolled down a certain amount of pixels and then show them new HTML ...

A guide on updating the appearance of a list of comma-separated tags using HTML, CSS, and jQuery

Is there a way to replicate the functionality of the tag section on this website for creating question entries? How can this be achieved? ...

Is there a way to align my two <div> elements together?

I am looking to align "Login" and "Register" with the height of the top, as shown in the example below for better clarity. https://i.sstatic.net/OArTq.png Here is how I want it: https://i.sstatic.net/MeI83.png Although I use Bootstrap 4, I prefer to ac ...

I am experiencing an issue with the button that is supposed to link to a section within the same page while it is located within the jumbotron. Interestingly, the button

I'm facing an issue with a button placed inside my jumbotron. The button is supposed to link to a specific section within the page, but it's unresponsive. Even hovering over it shows no interaction. Strangely, if I move the button outside of the ...

Tips for creating a responsive background image without excessive scaling:

I'm currently working on a website with a focus on responsibility, and I've incorporated 'waves' SVG images as a background-image. The issue arises when viewing the site on smaller screens, such as mobile devices, where the background a ...

Utilizing jQuery to correspond with CSS media queries

Continuing from my previous question about an automatic jQuery image slider, you can refer to it here. I have made some changes in my CSS using media queries and I am trying to incorporate them into my JavaScript code using an 'if / else if' sta ...

Transform Array into an unordered list with list items

Currently, I am dealing with a file that contains strings of file paths in the following format: ./CatDV/S1/SFX/steam/6004_90_04 LargeHeadlightSm.wav ./CatDV/S1/SFX/steam/AirHissPressureRe HIT032001.wav ./CatDV/S1/SFX/steam/Impact_Metal_Bullet_Hit(1).wav ...

Adjust image size to maintain consistent dimensions

Is there a way to resize the images so they maintain the same aspect ratio? Currently, all the images are appearing distorted. https://i.sstatic.net/czpto.png Here is the HTML code for the card: <div class="container"> <div class="flex- ...