Column div being obscured by footer

My footer is causing overlap issues with the div above it on my mobile website. Here's a visual representation:

Current view on my phone:
https://i.stack.imgur.com/RpvWM.png

Desired view:
https://i.stack.imgur.com/KHVcm.png

The code for the area boxes is as follows:

<div class="area-blocks">
    <div class="box-area col-xs-6">
        <div class="area-box">
            ...
        </div>
    </div>
    <div class="box-area col-xs-6">
        <div class="area-box">
            ...
        </div>
    </div>
</div>

CSS for the area boxes:

.box-area {
    background-color: #BA5e8e;
    padding-right: 20px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.box-area:nth-child(2n) {
    border-radius: 10px 0 0 10px;
}

Footer code:

<div id="footer">
    ...
</div>

CSS for the footer:

#footer h2 {
    color: #FFFFFF;
    margin-bottom: 20px;
}
...
@media (max-width: 767px) {
    .footer-top {
       ...
    }
}

I hope this information helps in identifying the issue. Thank you! ~ Rik

Answer №1

I'm noticing that not all of your styles are being included, even after loading the bootstrap CSS. Your layout doesn't quite match the example you provided. To address this issue, try adding .row to both of the main divs like so:

<div class="area-blocks row">

and

<div class="row" id="footer">

By incorporating these changes, it should help resolve the discrepancy.

Upon closer inspection of your code, it seems that the following snippet is causing the problem:

.area {
    height: 35vh;
}

To rectify this, consider modifying the above section and utilizing @media queries for responsiveness.

If I introduce the following adjustment

.area-blocks {
    position: relative;
    display: block;
    width: 100%;
    margin-bottom: 20px;
    height: 35vh;
}

and eliminate height: 35vh from .area, the visual appearance improves significantly.

Answer №2

To create the illusion of a footer's height, you can insert a div with a specific class right before your actual footer like this:

HTML:

<div class="fake-footer-height"></div>
<div id="footer">
....
</div>

CSS:

.fake-footer-height{
    height: // specify the height to match your #footer
}

This is a simple trick I often use for fixed footers, but it also works for footers in other positions.

Best regards!

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

Function activation in Element requires a double click to initiate

I've encountered an issue with a web element I'm working on where the click function only triggers after the first click, rendering the initial click ineffective. Here's the code snippet in question: HTML: <div> <a href="#0" cla ...

Extract information from the table using $_POST

I possess a datatable within a form. Inside that table, there is a column designated for setting a price. Upon submitting the form on the same page, the $_POST data fails to populate. Consequently, I am in need of inserting it into the MySQL db post-submit ...

The presence of a PDF document within an iframe is causing overlapping with another element

I am facing an issue on a screen where I have to display pdf or html content using an iframe. To show the PDF or HTML, I am using an iframe and then displaying a popup when necessary to cover the entire screen. This setup works perfectly in most browsers. ...

Adding custom CSS and JavaScript to the TYPO3 backend: A step-by-step guide

Is there a way to incorporate css and javascript files into the backend? I'm aiming to enhance custom created content elements with these files, making them more visually appealing for users. Platform: TYPO3 v9 Method: Composer Mode Purpose: Cu ...

The dropdown menu adjusts its value based on the selected radio button

When I select the "12 hour" radio button, the drop-down values change to 1 am - 12 am and 1 pm - 12 pm. If I select 24 hours, then the values change to 1-24. Below is my code: <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script> ...

Alter the loaded image based on the switch's current status

I am working with AngularJS material and I want to dynamically load an image based on the status of a switch. Here is the relevant HTML code: If the switch status sw_status.sw1 is true, then load the image truePic.jpg. If it is false, load the image false ...

The Scottish flag isn't displaying on my website, but all other Emoji 5 symbols are working perfectly

When I build my website with PHP, I include header('Content-Type:text/html; charset=utf-8'); at the start. Interestingly, the Scottish flag emoji ...

Offspring of a parent with a "flex: 1" attribute and a grandparent with a "min-height" property defying the "width: 100%" rule

Is it possible to have a hidden footer just below the screen's bottom and allocate the remaining height to content children without inheriting max-height all the way down? The "Grand child" element is not occupying the full height: body { marg ...

The Google calendar integration is working, but the appearance leaves much to

I embedded a Google calendar, but I'm having trouble centering it on the page without it overflowing onto the top menu. Can you help me fix this issue? If you'd like to see what I'm referring to, you can visit this link: ...

What can I do to prevent the border from breaking apart when I zoom in?

To address the problem of the 1px black border at the bottom of the header being cut off, try zooming into the page and scrolling right. How can this issue be resolved? ...

What steps can be taken to ensure that an element is perfectly centered within a div?

I have a div containing some images: <div> <img src="1.png"> </img> <img src="1.png"> </img> </div> Currently, the layout in browsers looks like this: ----------------- |XX | ----------------- H ...

Experiencing an overflow of redirects in PHP contact form

I am encountering an issue on my website where there are too many redirects occurring when attempting to submit a form that is supposed to be sent via email. The connection between the form and email seems to be correct. Form Code: <section class=" ...

HTML: Determine the Precise Location of a Div Element That is Centered

Imagine I have this image: Is there a way for me to determine the x/y or left/top properties of my canvas if it is centered using the following CSS: #canvas-container { width: 100px; height:100px; margin: 0px auto; } Note ...

I would like my division to split into two halves, each with a width of 50%, and be aligned next to each other using fxLayout

<div fxLayout="row" fxLayoutAlign="space-between" style="background-color: blue;"> <div fxLayout="column" style="width: 50%;">1stOne </div> <div fxLayout="column" styl ...

What is the reason for the inconsistency in CORS post requests working for one scenario but not the other?

Currently, I am facing an issue while attempting to add email addresses to a mailchimp account and simultaneously performing other tasks using JavaScript once the email is captured. Here's the snippet of my JavaScript code: function addEmail(){ v ...

Having trouble customizing the appearance of wtform attributes

Hello Everyone, Here is the content of the .py file: from flask import Flask, render_template, flash, session, redirect, url_for from flask_wtf import FlaskForm from wtforms import StringField,SubmitField from wtforms.validators import Da ...

Adjusting the height of a GAS iframe in WordPress with iframe-resizer: A step-by-step guide

I would like to embed an iframe of my Google Application Script Web into my WordPress site without the scroll bar. Refer to the image below for context. https://i.stack.imgur.com/7L6Tw.png I encountered an error message while attempting to use the iframe ...

Make the <textarea> occupy the entire available space

How can I make a <textarea> occupy all available space within a <td> element? Upon clicking inside the table cell, the <textarea> should display with precisely the same dimensions as the cell itself, resembling an Excel spreadsheet. I h ...

Adjusting the thickness of the CSS cursor line upon entering an input field

Having an image as the background for an input field has been causing issues for me. Although I can adjust the line-height and font-size easily, the cursor line appears outside of the background image when clicking inside the input field. Is there a speci ...

Listening for position changes using jQuery events

It is essential to be able to track the relative position of elements, especially when dealing with dynamic layout issues. Unfortunately, there are no built-in options in CSS to listen for changes in position() or offset() attributes. Reason: Changes in a ...