The footer hovers above the div element

Currently, I am facing an issue where my footer is constantly floating on top of my div. Surprisingly, this problem only occurs on mobile and tablet resolutions while working perfectly fine on desktop view.

The main problem lies in the fact that the footer keeps obstructing the content of the page at lower resolutions such as mobile and tablets.

Although I have diagnosed the root cause behind this issue, I am struggling to find a suitable solution. The main culprit here is a floating div that overlaps the footer. Interestingly, other pages demonstrate no signs of this issue with the footer functioning as intended. For reference, I have included the necessary CSS code below.

Here is a snippet from the problematic page:

<div>
    <img />
</div>
<div class="overFlow">
    Floating div positioned above the image, causing the footer overlap
</div>
<footer>
    Footer element that remains stationary on desktop but floats on mobile devices
</footer>


<style>
    .overFlow {
        position: absolute !important;
        top: 50%;
        left: 0%;
    }
</style>

Answer №1

If you find the top:50% positioning unnecessary, simply remove it. However, if you require the element to be at 50%, consider using media queries.

@media screen and (max-width:750px)
{
.overflow
{
position:absolute;
top:0%;
}
}

This will ensure proper display on desktop screens and resize appropriately for mobile devices under 750px, with the element positioned at the top and footer at the bottom when width is exactly 750px.

Thank you!

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

Dealing with unsupported CSS properties in Next.js or implementing @supports directives in Chakra-UI

Currently, I am working on a React component that adjusts opacity values based on the support for the CSS backdrop-filter directive: background={(() => { const opacity = isBackdropFilterSupported() ? 0.75 : 0.98 return ( `linear-gradient( ...

Element translation results in the expansion of the page's width

I am in need of assistance with translating multiple divs stacked on top of each other so that each layer slides away. I have attempted to use animate.css for animation and jQuery to detect when the animation ends and add a class to hide the container to p ...

How can I make my Grid items in React and Material-UI occupy the entire horizontal space without wrapping to the next row?

I am currently utilizing Material-UI within a React 16.10 project. My goal is to create a table where the left column consists of an icon, while the right column displays a label and address stacked on top of each other. I want the items in the right colum ...

Exploring PHP sessions for website interactivity

With a form, I collect data and use session storage to maintain a history on my page. When clicking on a line from the history, I want the data to autocomplete in the form. Despite attempting an example from another page, it's not functioning as desir ...

How to Retrieve Checkbox Values from Multiple Rows Using JavaScript

I have a variety of module rows that allow users to manage access rights by selecting specific options. My goal now is to extract the checked boxes from these checkboxes with the name "config{{$field->id}}". Below is the current functioning code. HTM ...

Initiate an Elementor popup upon form submission (After submit event) using Contact Form 7 in WordPress

I have incorporated Elementor popups and contact form 7 into my WordPress website. Currently, my goal is to activate the Elementor popup after the contact form 7 form has been submitted. Below is what I have tried so far, and there have been no console er ...

Sorry, the provided text is already unique as it is an error message

I'm currently using the react-highlight-words package to highlight text inputted into a textbox After checking out the react-highlight-words documentation, I noticed that they are using searchWords as an array. https://www.npmjs.com/package/react-high ...

The <footer> element refuses to be placed at the bottom of the page

Struggling to keep my <footer> tag at the bottom of my page despite trying various techniques. Check out my website below to see the issue in action: ...

Unusual actions regarding flexible CSS style sheet

There have been countless times when I have utilized a CSS technique that I discovered on my own. When I need a dynamic stylesheet that can be included in an HTML document, I use CSS files that are not actually CSS files, but PHP files instead. For example ...

What are the disadvantages of not incorporating the main CSS file directly into the web page?

Optimizing the loading time of my webpages is a priority for me, especially when it comes to first-time loading and from cache. Despite that, I still prefer to have the browser re-validate all resources to avoid any strange displays or update issues caused ...

"Enhance Your Table Design with Zebra Cells Using CSS in rich:data

How can I achieve a zebra color effect in every other cell of a rich:dataTable using CSS? <rich:dataTable value="#{uploader.files}" var="_data" id="files"> <rich:column> <f:facet name="header"> <h:outputText ...

Ways to determine if a specific text in HTML is already assigned a class name?

How can I modify my function to highlight selected text with the mark tag, and then un-highlight it if clicked again? highLightText() { var selection = window.getSelection(); console.log('this is the selection: ', selection); var ...

Two-sided vertical CSS menu

I'm struggling to design a layout with two vertical menus flanking the main content section. Despite experimenting with different combinations of inline, relative, and fixed positions, I can't seem to make it work. Here is the Fiddle link for re ...

Guidelines for placing an HTML element in relation to another HTML element using CSS or JavaScript

Is there a way to position an HTML element in relation to another using CSS or JavaScript? I have attempted to copy the inner HTML of the "second-element" and append it inside the "first-element", but this approach is causing issues with other functional ...

Prevent access to website during execution of background tasks

Whenever a user visits the homepage, I need to verify that default values on the database are in place (if this is not the correct location for the check, please advise). Here's what needs to happen: Determine if the database is empty (if not, skip ...

Creating an Array of dynamically generated elements using jQuery

A dynamic table is being generated using jQuery's .append() function: $el.append('<tr data-id=' + data[i].id + ' data-token=' + data[i].token + '><td>' + data[i].order + '</td>\n\<td&g ...

Bootstrap 5 and Vue 3 team up to create a stunning masonry layout

I've been struggling to find a proper solution for implementing a masonry layout in Vue 3 with Bootstrap. I tried using Bootstrap 5 cards with the Masonry CDN, but it resulted in squeezed and overlapping cards, failing to achieve the desired layout. I ...

Retrieving the image coordinates using jQuery or JavaScript

I need to find a way to retrieve the coordinates of an image within a div element, rather than the screen coordinates, when a user right-clicks on it. Can anyone advise me on how to achieve this? <div id="Boma" style="width: 1000px; height: 600px; po ...

Tips for choosing an attribute within a list with a CSS selector and Selenium

Is it possible to use a css selector to target an element within a <li> using Selenium? Below is the code snippet in question: <div id= "popup"> <ul> <li> <div id="item" option= "1" ....> </div> < ...

The ng-repeat directive in a row is malfunctioning

Just starting out with angularjs and facing an issue with getting data using ng-repeat within a div that is part of a row. I have implemented filtering and pagination from a dropdown, but it doesn't seem to be working as expected. Any assistance would ...