Place the footer element at the bottom of the div container

I am struggling with positioning a fixed footer in a div. Despite applying bottom: 0px; position: fixed;, the footer ends up at the bottom of the page and doesn't stay fixed within the div. This issue is really frustrating me, as I usually have a good grasp on these concepts. Take a look at my code on this JSFiddle link and let me know what you think might be causing the problem.

Answer №1

When using position fixed, keep in mind that it is relative to the entire document. To ensure proper layout, make the parent element relative and the footer element absolute:

Check out the DEMO here

.post-contain { position: relative; }
.author-box {   position: absolute; }

Additionally, there is a query about why the paragraph in the footer is set as relative. Please refer to the updated demo for clarification.

Answer №2

When using position: fixed, the element is fixed in relation to the page itself.

To achieve the desired effect, you should set: .post-contain { position: relative } .author-box { position: absolute }

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

Creating a customized design for your jQuery UI modal dialog box using CSS

I recently had to customize the jqueryui modal dialog in order to meet the standards set by my company. Currently, I am facing a cross-browser issue with the float and width of the input labels. You can view the sample website here: http://inetwebdesign. ...

What is a solution to prevent style.css from being recognized as the Jekyll Page?

Currently, I am utilizing an expression {% assign mypages = site.pages | sort: "order" %} {% for page in mypages %} {% unless page.exclude %} <a href="{{page.url|absolute_url}}"> {{ page.shortname }} <span class="rate">{% include indexmod.h ...

What is the best way to access an email link from an existing browser window?

Currently in the process of creating a Signup/Verify Email system. Here is how it works: User signs up on a webpage at /Signup.aspx and provides their email address (they are instructed to check their email). They receive an email titled "Verify your ema ...

Screen remains blank as the React webpage fails to load

Hello, I am having issues with my React page not showing up. Can someone please review my code to see if there are any errors? Here is the edited program: index.html <!doctype html> <html lang="en"> <head> <meta charset ...

After a two-second period of inactivity, the buttons on the item should trigger an action

I have a scenario in mind that I want to implement: When the user clicks on either the "Plus" or "Minus" button. If the user doesn't click on any of those buttons within 2 seconds, then we assume that the current quantity should be sent to the server ...

Let's talk about the CSS properties for centering content and automatically

I've been struggling with getting my navbar to center and adjust its width based on the content inside. Can anyone help me with this? <nav> <ul id="menu" class="black"> <li><a href="index.html">Home</a></l ...

The positioning of the Zorro table column remains flexible despite the presence of nzLeft

I am currently developing a project using Angular. Within one of my components, I have a table that displays some data. This table is generated by the ng-zorro table module. However, I've encountered an issue where setting a table column or header wi ...

Is there a way I can create a slight gap between the icon and the text in this area?

After learning Reactjs and JavaScript, I have encountered a problem that I need advice on. In the image provided, the "Sign in" text does not have proper spacing between the icon and the text, unlike the other menu items. https://i.stack.imgur.com/b663b. ...

Make sure to always nest child divs within their parent div to maintain

Hey there, I have a question that might seem silly to some. I've come across similar questions but none of the solutions worked for me. The problem I'm facing is with two nested divs - one inside the other. I want the inner div (taskbar-bar) to ...

implementing jqBarGraph on my webpage

Hey there! I have been trying to add a graph to my HTML page for quite some time now. After doing some research, I discovered that using the jqBarGraph plug-in makes it easier to create the desired graph. Below you will find the code that I have on my webp ...

Enclose a text line within a flexible div container

I've encountered an issue with my CSS: I have a dynamic div containing a single line of text that needs to wrap every time the width of the div resizes to a smaller size. The challenge lies in having the text inside a table, serving as a directory fo ...

What is the best way to convert minutes into both hours and seconds using javascript?

In order to achieve this functionality, I am trying to implement a pop-up text box where the user can choose either h for hours or s for seconds. Once they make their selection, another pop-up will display the answer. However, I am facing issues with gett ...

Determine if the object makes contact with the canvas boundary

I'm quite new to working with Canvas HTML5 and I'm trying to figure out how to detect if the 'Hero' character in my game has collided with the border of the canvas. Ideally, I would like to display an alert or some kind of message when ...

How to display only a portion of content using UI Bootstrap collapse feature

In my Angular.js application, I currently have a row of buttons that open up new routes to display partial views. Now, I need to modify some of these buttons to trigger a ui.bootstrap Collapse feature with the view inside it. The template code from the ui. ...

Discovering methods to store browser credentials securely in jQuery

I need to prevent the login button from being enabled when either the username or password fields are empty. Check out the code snippet below: $(document).ready(function(){ $('input').on('keyup blur mouseenter', function(e) { ...

Preserving form data using JavaScript exclusively upon submission

Hey there! I'm facing a little issue with a Form that has multiple checkboxes and a piece of JavaScript code designed to save the state of each checkbox when the user hits submit. My problem is that, currently, the checkbox state is being saved even i ...

Utilizing PHP to Retrieve the Value of an HTML5 Range Slider with Two Slides

I'm struggling with this code snippet: HTML: <div class="unit"> <div class="slider-group"> Budget: <label id="2-h"></label> </div> <div id="slider-2-h"></div> <input type=" ...

Enhanced User Experience Through Triggered Content Recommendations based on Scrolling Patterns

When a user scrolls beyond a certain point on a webpage, I would like a recommended content popup to slide out from the right side at the bottom of the page. An excellent example can be seen on USAToday where a blue recommended box appears as you scroll d ...

Navigational Scroll Parallax Issues

I have been trying to implement a basic 2 layer parallax effect using ScrollMagic on my index page. The layout consists of a large image with content below it, but I am facing some challenges. Despite going through the documentation and source code multipl ...

Restrict the dimensions of the HTML5 Facebook comment field

I need help limiting the vertical height of Facebook comments generated by the code below. I know how to set the width using the data-width parameter, but I'm not sure how to limit the vertical height of the comment box. Can anyone provide guidance on ...