Tips for placing an absolutely positioned element at the bottom without it overlapping with other elements

I am facing a challenge with a container where the text can expand, but the absolute positioned child element needs to remain fixed at the bottom without overlapping the content above.

I have searched for solutions, but most of them rely on flexbox which is not compatible with internet explorer 9.

Here is my attempted solution:

.container{
  max-width: 940px;
  margin: 20px auto;
  border: 1px solid red;
}
.table{
  display: table;
  width: 100%;
}
.table-cell{
  display: table-cell;
  position: relative;
  height: 260px;
}
.absolute{
  position: absolute;
  bottom: 0;
}
<div class="container">
  <div class="table">
    <div class="table-cell">
      <div>
        This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content.
        This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content. This content can go very bring, push the absoulte position element to the bottom always without overlapping parent content.
      </div>
      <div class="absolute">
        asdasd
      </div>
    </div>
  </div>
</div>

Answer №1

To solve the issue stated in the comment, one suggestion is to include a padding-bottom to adjust the height of your long text div based on the content within the .absolute element. For those utilizing jQuery, it is advisable to implement this adjustment dynamically. Simply determine the necessary padding-bottom by referencing the height of jQuery('.absolute').height()

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

What are some ways to avoid an image looking faded when adding it to the scene background in Three.js?

I've been experimenting with loading images onto the scene background using the TextureLoader() class to prevent them from appearing greyed out. Following a tutorial on three.js https://www.youtube.com/watch?v=xJAfLdUgdc4&list=PLjcjAqAnHd1EIxV4FS ...

The state update was not completed before another update had already begun

Check out this object I have: { "Item1": "books", "Item2": "pen", "Item3": "desk", } I receive it in my react application through a rest API. const Items: React.FC = () => { interface DataType { [key: string]: string; } const [info, ...

Element mysteriously concealed in certain Safari cases, consistently visible in Firefox and Chrome

A new angular application has been developed as a "bounce" page for an upcoming social iOS app currently in public beta. Users have the ability to share their profiles by simply providing a link to the site. If the page is accessed via an iOS device w ...

Tips for utilizing the onload attribute alongside the ng-controller directive to run a function that has been established within the controller

When trying to call the submit() function as soon as the page loads, I keep encountering a submit() method not found error. The positioning of ng-controller and onload is confusing to me. If there is an alternate method in Angular to achieve this, please ...

What is the best way to display array outcomes with a jQuery conditional statement?

I am facing an issue while trying to retrieve store locations using conditional statements. Currently, when I select Dealer, Wholesale, or Retail from the options menu, the corresponding results are displayed. However, the problem arises when I select All ...

Is Axios phasing out support for simultaneous requests?

According to the current axios documentation, there is a section that is not very well formatted: Concurrency (Deprecated) It is advised to use Promise.all instead of the functions below. These are helper functions for managing concurrent requests. axio ...

Calculating the number of checked checkboxes using PHP and HTML

Greetings! I am just starting to learn php and I have a question about how to count the number of 'checkbox' items that are checked when I click on a submit button. Here is an example: <input type = "checkbox" value = "box" name = "checkbox1 ...

Setting the z-index of the parent element causes issues with overlapping

When adjusting the z-index property of the parent element, I am experiencing issues with overlapping elements. Below is the HTML and CSS code: .black_gradient{ width:100%; height:100%; background: linear-gradient(0deg,rgb(75, 75, 75) 20%, rgba(75,75 ...

Utilize npm to construct a Vue application and execute it on a Raspberry Pi device

My roommate and I are currently working on a Vue app project together, and we're aiming to deploy it on our Raspberry Pi. We're wondering if there's a way to npm build the final app on our PC and simply start the server on the Pi without hav ...

Tips for creating gaps between wells within a Bootstrap row

Utilizing bootstrap, I am aiming to position two wells side by side without them being squeezed right next to each other. However, I am encountering some issues with achieving this. Here's the code snippet I am currently using: <div class="contai ...

What is the process for updating my API data with information submitted through a form?

I am encountering a challenge with my Products component that fetches data from an API endpoint. I also have a Form component where users can input data to update the Products component, displaying both fetched and new data. How can I achieve this? I passe ...

Encountering the error "object object" while attempting to pass parameters to my servlet through AJAX

Experiencing an issue where my ajax call is ending up in the error function. I have noticed that my success function is empty, but I was expecting to receive messages from my servlet whether the data provided is correct or incorrect. The popup dialog displ ...

Encountering a 404 error for a JSONP Get request while deploying on IIS

When utilizing jquery AJAX with datatype jsonp, everything runs smoothly on my local development environment even with a large amount of data. However, once deployed on IIS, it only functions properly for requests shorter than 2121 characters; anything mor ...

Using Material-UI to add a pseudo class '::before' with component class properties

I attempted to utilize a pseudo class for the mui-app-bar but did not have success. I've researched this issue on various platforms without finding a solution. Below is how my component is currently structured: const styles = (theme: Theme) => cre ...

Issue with improper lighting on Three.Geometry objects when using LambertMaterial in Three.js

After enhancing my initial version of this inquiry (previously asked question) with a JSFiddle showcasing the latest build of Three.JS and illustrating the lighting issue on Three.Geometry, I encountered difficulties with dependencies in Stack Snippets. Ho ...

What is the easiest way to toggle the display of the hamburger menu in a basic grid or flex layout?

I have recently created a grid and flex-based menu. How can I make the hamburger menu function to show/hide the menu on click? Is there a way to achieve this without using JavaScript? Here is the current code snippet: .menu { display: grid; g ...

IE8 is giving me a tough time with CSS3 + HTML5SHIV + CSS3PIE Border-radius; it works fine on IE7, 9, and

Working on a site at , which is constructed using: Twitter Bootstrap HTML5 + CSS3 HTML5SHIV CSS3PIE Problem: Border-radius styling for the navbar link when active is not functioning in IE8 despite using CSS3PIE. However, it works fine in IE7,9,10 (confi ...

Center the content of the HTML body

Despite my best efforts, I seem to be making a mistake somewhere. While creating a bootstrap website at , the site appears well and aligned in the center. However, when I try to adjust the screen size to less than 850px or even smaller, all the content shi ...

Navigating through Leaflet to reference a .json file

Looking to integrate a .json vector layer into a Leaflet.js map, which can be seen on the GitHub page here, with the source code available here. Here's a condensed version of the file for reference (full version visible on the linked GitHub page). & ...

The glitch in jQuery's animate function callback

In my code to animate the sliding out of a div, I encountered an issue: var current = $('.s_text:visible'); current.animate({ right: 1014, opacity:0, },{queue: false, duration:2000}, function() { current.hide(); }); Strangely, the callbac ...