The bottom section is not properly positioned

For some reason, my HTML and CSS are not functioning correctly. I am particularly confused about the behavior of the span element, as it seems to be working fine on other pages.

The footer does not seem to be interacting with any elements, causing it to stay at the very top of the page. (I even attempted moving the footer to the <footer> tag, but the issue persisted.)

An illustration of the problem can be found in the attached image below.

Below is a snippet of my code:

.aboutuspagetitle {
  width: 100%;
  color: rgba(159,74,74,1);
  position: absolute;
  top: 176px;
  left: 660px;
  font-family: Merriweather Sans;
  font-weight: Bold;
  font-size: 40px;
  opacity: 1; 
}
.aboutuspagedesc {
  width: 100%;
  color: rgba(0,0,0,1);
  position: absolute;
  top: 313px;
  left: 30px;
  font-family: Merriweather Sans;
  font-weight: normal;
  font-size: 33px;
  opacity: 1;
  text-align: left;
}
.footer {
  clear: both;
  position: absolute;
  height: 75px;
  background-color: #121212;
  font-family: Karla Tamil Upright;
  color: white;
  text-align: center;
  left: 0px;
  width: 300%;
}
.foot1{
  width: 304px;
  color: rgba(255,255,255,1);
  position: absolute;
  top: 0px;
  left: 568px;
  font-family: Karla Tamil Upright;
  font-weight: normal;
  font-size: 18px;
  opacity: 1;
  text-align: center;
}
.foot2{
  width: 304px;
  color: rgba(255,255,255,1);
  position: absolute;
  top: 45px;
  left: 568px;
  font-size: 14px;
  opacity: 1;
  text-align: center;
}
<body>
  <span class="aboutuspagetitle">ABOUT US</span>
  <span class="aboutuspagedesc">
    <p>Lorem ipsum dolor sit amet.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut commodo nisl ut justo tincidunt, ac laoreet nunc elementum.</p>
  </span>
  <div class="footer">
    <p class="foot1">THIS IS AN ADDRESS</p>
    <a href="https://www.google.com"><span class="foot2">© 2021</span></a>
  </div> 
</body>

Answer №1

Do not forget to include bottom: 0; in the footer style and position it using position: fixed; so that it remains at the bottom even when scrolling.

.aboutuspagetitle {
  color: rgba(159,74,74,1);
  font-family: Merriweather Sans;
  font-weight: Bold;
  font-size: 40px;
  text-align: center;
}
.aboutuspagedesc {
  width: 100%;
  color: rgba(0,0,0,1);
  font-family: Merriweather Sans;
  font-weight: normal;
  font-size: 33px;
  text-align: left;
  padding-bottom: 75px;
}
.footer {
  display: flex;
  position: fixed;
  height: 75px;
  background-color: #121212;
  font-family: Karla Tamil Upright;
  font-weight: normal;
  color: white;
  text-align: center;
  left: 0px;
  bottom:0;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.foot1{
  color: rgba(255,255,255,1);
  font-size: 18px;
  margin: 0;
}
.foot2{
  color: rgba(255,255,255,1);
  font-size: 14px;
}
<body>
  <h1 class="aboutuspagetitle">ABOUT US</h1>
  <span class="aboutuspagedesc">
    <p>Lorem ipsum dolor sit amet.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut commodo nisl ut justo tincidunt, ac laoreet nunc elementum.</p>
  </span>
  <footer class="footer">
    <p class="foot1">THIS IS AN ADDRESS</p>
    <a href="https://www.google.com"><span class="foot2">© 2021</span></a>
  </footer> 
</body>

Some tips to keep in mind:
Avoid using position absolute excessively as it can cause misalignment on different screen sizes.
Also, do not clutter your styles with unnecessary properties. If something is not working, remove it from the style altogether!

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 conceal a DIV element by clicking outside of it

I am facing an issue with hiding a div when clicking outside of it. Here is the code I have tried: <div id="mydiv">The div must be above button</div> $('#mydiv').click(function(e) { e.stopPropagation(); }); $(do ...

Distinguishing background colors depending on the browser's compatibility with CSS properties

I've successfully designed a polka dot background using pure CSS: .polka-gr{ background-image: radial-gradient(#FAFFB3 20%, transparent 0), radial-gradient(#F1C3CB 20%, transparent 0); background-size: 30px 30px; background-positio ...

Is there a way to automatically focus on a newly created element using JavaScript?

Whenever a user presses the enter key in a single input field, it will become disabled and a new one will appear. I am looking to automatically focus on the newly created input field each time, while also removing the default blue border that appears when ...

Apply a class to a div element when the WooCommerce cart is devoid of any items

Is there a way to apply a class or style to an element that displays the cart count only when the cart is empty? Currently, I have the following code in my header.php file which shows the cart count correctly, but does not update the color: header.php ( ...

Dynamically adjusting the size of two block elements

I'm facing a challenge that seems insurmountable at the moment. Picture this: there's a container block with fixed height and width. Inside it, two blocks reside - one orange and one blue. The goal is for the orange block to adjust its height b ...

I tried looking on w3schools for an explanation in PHP but couldn't find one. Can someone please clarify this

Hey everyone, I'm currently new to learning PHP and have noticed that w3schools doesn't explain the purpose of certain things. Since I'm not too familiar with all the terms and concepts, I was hoping someone could help me out by going over t ...

Integrating Images Seamlessly with Text using HTML and CSS

Still getting the hang of this! I'm working on a webpage with an image and text side by side in separate divs. I've positioned them correctly, but when I resize the page, the text changes size while the image stays the same. I want the text to al ...

Is the imported style file not properly scoped?

Whenever I attempt to import a CSS file using this method, the styling is not properly scoped. Is it necessary to write the styles within a style tag for them to work correctly? I have been experimenting with this in Vue-cli. <style scoped> @im ...

What is the best way to eliminate the selected text while moving/grabbing an element?

I'm facing an issue with removing the background text image when dragging elements. I have tried troubleshooting but haven't found a solution yet. For reference, I looked at this link: HTML5 Drag and Drop anywhere on the screen function drag_sta ...

Discovering the page load times of web elements on a website with the help of Selenium WebDriver

On my HTML5 webpage, there are 4 charts that each take a different amount of time to load after the static content has already loaded. The loading process is indicated by a 'rendering' circle image for all 4 charts. I am looking for a way to dete ...

Troubleshooting: Resolving issues with Bootstrap path in subfolders on your website

As a beginner using bootstrap 3, my goal was to create a header that I could easily call on any new page I create. However, I encountered an issue when I tried to place the code from the original file into a new folder with an index.php file. Here is an i ...

Listing items in a table using ng-repeat

I'm currently working on constructing a table using ng-repeat, but I also need to incorporate a toolbar. The table design I have in mind is similar to the one shown in the image below, however, I require additional rows to be inserted under the sectio ...

Modify iframe form action URL dynamically upon user visiting the URL with a specified parameter

Below you will find a code example: The page URL is: <html> <body> <h1>main page</h1> <iframe src="http://example2.com"> <form id="test" action="http://example3.com?id=1"> ... </form&g ...

How can I remove the color of a button in jquery after it's been clicked?

<button style="background-color:lightblue" id="extractv"> <b> Extract<br>v </b> </button> ... $("#extractv").click(function () { $("#extractv").removeAttr("style"); }); Upon clicking the button, my ...

JavaScript Error: Uncaught TypeError - The property 'remove' cannot be read because it is undefined

My modal window setup allows for opening two separate modals one after another, with the capability to close them individually (closing the second modal while keeping the first one active). (All the necessary code snippets are included below) let open_mo ...

Expanding Material Ui menu to occupy the entire width of the page

I'm encountering an issue with a menu I created where I can't seem to adjust its height and width properly. It seems to be taking up the full width of the page. import React, { Component } from "react"; import Menu from "@material-ui/core/Menu"; ...

Authenticating the Gmail API using a specified user ID

Is there a way to manually input email and password for authentication in the Gmail API without using the default Google popup? I need users to enter their login credentials directly, but I can't figure out how to do it. The code I am currently using ...

Issue: The system does not recognize 'cleancss' as an internal or external command

After successfully installing clean-css via npm command line, I was eager to start using it to concatenate and minify some css files. However, my excitement quickly turned to frustration when I encountered this error: 'cleancss' is not recognize ...

Best practice for showcasing an MVC Form with the use of Bootstrap

I am facing an issue with my form layout while trying to capture user input. The use of Bootstrap is creating two columns for text boxes and their labels, but the alignment goes off track with the last EditorFor element. I'm questioning if I am misusi ...

Solving the issue of .css being blocked due to MIME type while building tailwind is a common problem faced by

https://i.stack.imgur.com/nrDgJ.png While working on my tailwind CSS project, I ran npm run build. However, upon opening the built index.html file, I noticed that the CSS file was not loading properly. How can I resolve this issue? I am unsure of what st ...