Element floating over, intersecting with the main content of the page

I am facing an issue with my CSS-styled footer that floats at the bottom of the page. When I resize the browser window, the footer overlaps the contents of the page. Although the footer is quite large, it should not overlay the page content.

body {
  padding: 0;
  margin: 0;
  font-family: 'Open Sans', sans-serif;
}
a {
  text-decoration: none;
  color: #64aba7;
}
strong {
  color: #fff
}
.container {
  min-height: 500px;
}
.header {
  margin-top: 60px;
}
.header,
img {
  display: block;
  margin-right: auto;
  margin-left: auto;
}
.content {
  display: block;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
  width: 500px;
}
.green-color {
  color: #25b04b;
}
.dark-green {
  color: #016838;
}
.footer {
  width: 100%;
  background: #00756f;
  position: absolute;
  bottom: 0;
}
.footer-container {
  display: block;
  margin-right: auto;
  margin-left: auto;
  width: 500px;
  padding-top: 20px;
}
.font-size-12px {
  font-size: 12px;
  color: #64aba7;
  font-weight: 50;
}
.one-third {
  width: 30%;
  float: left;
  margin-right: 3%;
  padding-bottom: 40px;
}
<div class="container">
  <div class="header">
    <img src="images/logo-large.png" alt="LegalHQ">
  </div>
  <div class="content">
    <h3 class="green-color">We are redevloping our website and will be back shortly</h3>
    <h4 class="dark-green"><i>In the meantime don't hesitate to call or email us</i></h4>
    <p class="dark-green">0330 999 1213
      <br /><a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="82eae7eeeeedc2eee7e5e3eeafeaf3ace1edacf7e9">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="553d3039393a153930323439783d247b363a7b203e">[email protected]</a></a>
    </p>
  </div>
  <div class="footer">
    <div class="footer-container">
      <div class="one-third img-div">
        <img src="images/small-logo.gif" alt="LegalHQ">
      </div>
      <div class="one-third font-size-12px">
        <strong>Legal HQ Limited</strong>
        <br />Virginia House
        <br />Floor 2
        <br />5-7 Great Ancoats Street
        <br />Manchester
        <br />M4 5AD
        <br />0161 974 0500
        <br />
        <a href="mailto:<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="42313732322d3036022e2725232e6f2a3339222962">[email protected]</a>"><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="196a6c6969766b6d59757c7e7875347168377a76316d77">[email protected]</a></a>
        <br />
        <a href="www.legal-hq.co.uk">www.legal-hq.co.uk</a>
      </div>
      <div class="one-third font-size-12px">
        <strong>Legal HQ Limited</strong> is regulated by the Ministry of Justice in respect of regulated claims management activities. <strong>Authorisation Number: CRM30929</strong> 
        <a href="www.claimsregulation.gov.uk">www.claimsregulation.gov.uk</a>
      </div>
    </div>
  </div>
</div>

Check out this link if you would like to experience the issue yourself. Try resizing the browser window to see the footer overlapping the main content.

Answer №1

To make the html and body height 100%, move the footer outside of the container, eliminate absolute positioning, clear floats on the div children, replace them with display:inline-block and set widths to 28% (or remove whitespaces between them). Alternatively, consider using text-align:center for the container if needed.

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

Ways to retrieve dropdown values

My HTML code is as follows: <select class="height_selected"> <option>Select Height</option> <option ng-model="userHeight" ng-init="1" value="1">123 cm</option> <option ng-model="userHeight" ng-init="2" v ...

Laying Out Content with Bootstrap4 Grid System and Nesting Rows

design Is it possible to utilize Bootstrap 4's grid system to replicate the layout shown in this image? Can rows be nested within a main row? I've been struggling to achieve this. ...

Struggles with conflicting versions of Jquery within asp.net

Here is a snippet of my jQuery function: $(window).scroll(function () { if ($(window).scrollTop() > offset.top) { $("#sidebar").css("marginTop", $(window).scrollTop.length - offset.top); $("#sidebar").css({ o ...

A guide to activating automatic filling of usernames and passwords in web browsers

On my login page, I aim to make the user experience seamless by automatically filling in the username and password fields once a user has logged in for the first time. This way, when they return to the login page, all they have to do is click the login but ...

Issue with Three.js GLTF loader peculiar behavior while attempting to incorporate three-dimensional text

I had an idea to import a prebuilt gltf scene created in Blender, then add some 3D text using the ttf loader and manipulate it. Each loader worked perfectly when used separately, but strange things started happening when I combined them into a single scrip ...

Increase the height of the div element by a specified number of

Is there a way to dynamically expand a div's height using CSS without knowing its initial height? I want to increase the height by a specific amount, such as "x px taller" regardless of its starting size. For example, if the div starts at 100px tall, ...

Exploring elements using dynamic xpaths in selenium

When working with Selenium WebDriver, I am facing difficulties selecting the <input class="cs-autocomplete-input" tabindex=""> element due to its fluid ID. This is because there are multiple items with the same class name on the web page, making it c ...

Creating an HTML element using jQuery isn't just about designing; it

When creating HTML elements using an Ajax call from the server-side, it can be challenging to align them properly on a responsive web page. Below is an example of how elements are generated with an Ajax call: var html = ""; $.ajax({ type: " ...

CSS3 consumes a high amount of resources

Currently, I am in the process of developing a hybrid app using Ionic. My main focus is on customizing the Ionic main CSS via SCSS and adding my own custom CSS as well. The layout of the app has been achieved without extensive use of JavaScript logic and i ...

Step-by-Step Guide: Customize the Background Color in an Angular 4 Select Dropdown Based on the Selected Option

I'm facing a challenge in setting the background color of a select element based on the color attribute of its currently selected option. I'm using Angular 4 for this task. An example of what I am attempting to accomplish is shown below: <se ...

Show a triangle positioned on the left side of the display

Looking for help with aligning a div to the left side of the screen CSS #nav { position: fixed; height: 50px; width: 50px; display: block; background-color: #000; } This particular div contains an icon that acts as a link HTML <div id="nav"> ...

I have come across this building error, what do you think is the cause of it?

My attempt to launch my company's React.js project, downloaded from Tortoise SVN, is encountering an issue. PS C:\Projects\Old EHR> yarn start yarn run v1.22.19 $ next start ready - started server on 0.0.0.0:3000, url: http://localhost:30 ...

Footer Design with Images in Bootstrap

Hi, I recently started using Bootstrap and I'm trying to add a fixed footer to my page with a logo that is taller than the footer itself. I want the footer and the image to be fixed at the bottom of the page, while the image extends beyond the footer. ...

Maintain the aspect ratio of an image within a flex container when the height is adjusted

I'm currently facing an issue with an image in a flex container. My goal is to maintain the image's ratio when the height of the container or window is decreased or resized. Check out this sample fiddle html, body { height: 100%; } .wrappe ...

The Angulajrjs popup timepicker is not located within the input row

Currently, I am working on creating a popup timepicker within a modal. My main goal is to have the button inside the input field rather than after it. Does anyone know how I can achieve this? Thank you. If you need more context, you can check out my plun ...

Tips for setting the tabindex on an element that has an opacity of 0

I have created a drag and drop image upload field with a hidden input element to style the upload button according to the design. However, I am concerned about accessibility and want the upload functionality to trigger when the user presses 'Enter&apo ...

JavaScript drag functionality is jerky on iPads, not seamless

I am currently attempting to implement a feature where I can drag a div (#drag) within its parent container (#container) using only pure JavaScript. This functionality is specifically required to work on iPad devices only. After writing a script that func ...

JQuery Falters in Responding to Button's Click Action

Forgive me for what may seem like a silly question, but as someone new to JQuery, I have been struggling to figure out why my function is not displaying an alert when the button is clicked. Despite thorough research on Google, I haven't been able to f ...

What is the best way to apply a :visited selector specifically to the most recently visited webpage?

I've noticed that all the pages I've visited on the site have now changed to the color I chose. However, my goal is for only the last page I viewed to be in the color I assigned. Thank you! ...

Can you explain how to utilize theme values in CSS within Mui?

Working on my React app with mui themes, I have the following in index.js: let theme = createTheme({ palette: { primary: { main: "#00aaa0", contrastText: '#fcf4d9', }, secondary: { main: "#D55B3E&quo ...