Footer is stubbornly stuck in the middle of the page, refusing to budge despite the

visit the live site here

Despite setting the body height:100%, my footer continues to get stuck mid-page on certain pages such as about and contact. I have tried specifying the footer height and using position:fixed, position:absolute, and bottom:0, but nothing seems to work. Any suggestions?

Update: Even attempting a "Sticky Footer" does not solve the issue; it causes the footer to be slightly off-center on the page.

body {
    background: #fff;
    font-family: london, Arial, sans-serif;
    height: 100%;
}

#container {
    width: 960px;
    margin: 0 auto;
    padding: 60px 0 120px 60px;
}
#footer {
    position: absolute;
    width: 340px;
    margin: 0 auto;
    bottom: 0;
    height: 120px;
}

Answer №1

Try adding a 100% height to your container with the code snippet provided below:

http://example.com/code-snippet

html, body {
    background-color:#f7f7f7;
    height:100%;
}
#header {
    position:relative;
    background:#666;
    min-height:50px;
}
#container {
    width: 860px;
    margin: 10px auto;
    height:100%;
}
#container p {
    font:1.8em normal Arial, sans-serif;
}
#footer {
    background-color:#444;
    min-height:60px;
}

<div id="header"></div>
<div id="container">
    <p>Welcome!</p>
</div>
<div id="footer"></div>

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

Adding an event listener to detect left or right mouse clicks - using onclick doesn't capture right clicks

I'm currently in the process of applying for an Internship through this Internship Link One thing that caught my attention right away is the issue with uploading or pasting a cover letter. When attempting to upload or paste a cover letter, it redirec ...

Avoid floating right elements all the way up if there are already elements floating left

I am struggling to position block 5 next to block 3 on larger screens, while maintaining the desired arrangement on smaller viewports. The blocks do not have fixed heights in my setup. You can see my codepen for a better understanding of what I'm try ...

Compatibility issues with jQuery observed in Firefox and Internet Explorer 11

Check out the code here: jsfiddle demo HTML CODE: <div class="first"> <!-- Part one --> <div class="acord_col"> <div class="img_class" id="exist_site"></div> <div class="intro_text"> </div> </div&g ...

The footer element is missing from the body section of the HTML code, causing the box shadow to not encompass the footer as intended

Having a problem in CSS where the footer is not appearing within the body element in the HTML code. The footer is placed between the body tags, but the box shadow defined for the body is not being applied to the footer. The code snippet below shows the CSS ...

Siblings selectors within Internet Explorer slow down significantly when using the :hover pseudo-class

Sample page: http://jsfiddle.net/y2pwqch6/6/ This particular example showcases a CSS selector known as the adjacent sibling selector: .l:hover + .r { color: blue } The issue arises when hovering over any element on the page, causing Internet Explore ...

Explore an illustration of a website with a hover effect

As I delve into the world of web development, I have taken up the challenge of replicating another website's layout to hone my skills. However, there is one aspect of this site that has me stumped =/ <div class="a"> <span>Teste</span&g ...

Looking for assistance navigating through a website's links using Selenium?

Trying to extract links from this webpage, specifically the ones listed in the footer. An example of what I'm dealing with: https://i.sstatic.net/PPvb0.png The goal is to scrape all links related to securities displayed in a table and then navigate ...

Issue with Next.js app styles persisting on pages after page refresh

I am currently working on my first next.js project, transitioning from create-react-app, and I've encountered an unusual issue. When I refresh the home page, the CSS styles persist without any problem. However, if I navigate to a different page like " ...

The view has no access to $scope but the controller does

I need to display the iso code using a $scope when selecting a country from a list. The list of countries is fetched through a $http call in a factory and then stored in a scope. ///////// get countries //////////////// tableFactory.getCountries().then(f ...

Is it possible to apply identical css styles to multiple ids at once?

Is there a way to accomplish this? .apple, .orange, .kiwi h1 {color: #892828;} I'm having trouble making it work. Any suggestions? ...

Running Protractor tests can be frustratingly sluggish and frequently result in timeouts

After spending most of the afternoon struggling with this test, I've tried different approaches but none seem to work. The task at hand is searching for users within the company, generating a table, and selecting the user that matches the name. Curren ...

Divs gracefully appear one after the other in a sequential manner

I am attempting to showcase a sequence of 4 divs in a row using the ease-in CSS transition feature. I came across this example that demonstrates what I am aiming for: http://jsfiddle.net/57uGQ/enter code here. However, despite my best efforts, I am unable ...

Swap out the hyperlink text for a dropdown menu when clicked and then revert back

Is there a way to dynamically switch between a label/text and a Kendo Combobox in a div using JavaScript when clicking on the text? The desired functionality includes: Clicking on the text displays the combobox, clicking away from it hides the combobox a ...

SASS malfunctioning, error messages popping up in command prompt while running gulp serve

As I develop a web app using AngularJS and Gulp, I encounter an issue where the CSS does not seem to work when running 'gulp serve'. Despite attempting to reinstall various components like node_modules, Node.js, and Gulp, the same error persists. ...

CSS - using numbers to create dynamic background images

I am looking to create a design where the background images in CSS display increasing numbers per article, like this example: This idea is similar to another post on Stack Overflow discussing using text as background images for CSS. You can find it here: ...

Creating personalized widths for bootstrap classes with SASS

I am interested in enhancing the bootstrap source code by creating additional w-XX classes. Specifically, I aim to include both w-40 and w-60. According to the documentation, modifying the $sizes variable is necessary for this customization. In my custom. ...

Aligning text appears fine in a full screen browser, but it can cause inconsistencies in appearance when resizing the window or viewing on a phone, as demonstrated in the

Hi there, I'm new to web design and I'm struggling to make my site look good on all screen sizes. I've created a page that should work well on any screen size: https://jsfiddle.net/garixakor/j0xck25v/1/ I attempted to center one of the par ...

Passing variables in Redirect() without exposing them in the URL; a methodical approach

After scouring the depths of the internet, I have been on a quest to figure out how to seamlessly redirect to a new page on my site while discreetly passing a variable without exposing it in the URL like so: www.test.com/?variable=dont.want.this.here I a ...

Adapt the stylesheet for mobile devices using CSS

I am struggling with updating file paths in CSS depending on whether the end user is accessing my site from a PC or mobile device. Below is my CSS code, where I attempted to redirect users if they are on a handheld device: <link rel="stylesheet" type=" ...

Showcasing the information stored within my li element, I am able to access and view the data through my console

I want to showcase the data in the browser Upon hitting the api call, I retrieve the data in my console. The challenge lies in displaying the data within my li tag. Below are snippets of my relevant code and the entire code can be found in the gist links p ...