Fixed Header/Footer with Scrolling Content

I recently encountered an issue with my website where the header and footer needed to remain fixed at the top and bottom of the screen while the content scrolls. I found some guidance on achieving this effect in a question on Stack Overflow, which somewhat worked for me. However, as I scrolled down the page, I noticed that the background-image for the content was getting chopped off. This puzzled me as I had set the background image to repeat vertically. Additionally, I observed that the footer seemed to be obstructing part of the content.

In order to create the desired scroll effect for the content, I added position: fixed; to the header and footer elements. The main content area was left with position: absolute; to ensure the footer stayed fixed at the bottom of the screen.

For reference, you can view the website in question by following this link: Link to website

Answer №1

  1. To start, ensure your footer has the CSS property bottom: 0 to make it touch the bottom of the page.
  2. Next, remove the position: absolute from the #content element.
  3. Lastly, include additional padding at the top and bottom of the #content section to prevent text from being hidden by the header or footer.

By following these steps, Firebug indicates that this should resolve the issue on your website. If needed, you can consult with Firebug directly by visiting their website.

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

ShoutEm Builder sufferers from vanishing HTML code

I am trying to insert an HTML5 element into the body of a ShoutEm screen using the ShoutEm builder. After pasting the element's HTML code into the description box, I can see the element. However, as soon as I click anywhere in the builder, the code an ...

Design a table without borders that is compatible for pasting into a Word document

I've been struggling to figure out the correct format for creating a border-less table that, when pasted in Word, will maintain its appearance as shown below: <strong>Foo</strong> <ol> <li value="0">This is zero.</li&g ...

PhoneGap: Upgrade HTML files for offline functionality

I am seeking to develop an app that offers basic information in a table format. Currently using PhoneGap, I have the necessary data and can input it into the HTML file. However, if there are any updates or changes to be made, do I need to hold off on pub ...

Using jQuery to apply the "a" class with the addClass method

The html structure below is giving me trouble: <div class="sub"> <a href="#" id="people">People</a> </div> The CSS for the "a" element is as follows: color:#999999; font-size:31px; I am attempting to use jQuery to change ...

How can I implement a recursive nested template call in Angular 2?

Hopefully the title isn't too misleading, but here's my dilemma: I am in the process of building an Angular 2 app and utilizing nested templates in multiple instances. The problem I am facing involves "widgets" within my app that can contain oth ...

Exploring the dimensions of elements in Polymer using offsetHeight and offsetWidth

Looking for advice on running a script when the page loads that relies on the offsetHeight and offsetWidth properties of an element. I've tried calling the script within the "ready" and "attached" functions, but it doesn't seem to be running when ...

On my WordPress Elementor website, I am looking to have the button on my product card linked to a specific

I found a product card design on codepen.io and tried to customize it by changing the colors. However, I'm struggling to get the button to work. Here is the product card code snippet: <div class="card"> <div class="imgBox&q ...

Using Laravel and Bootstrap v4, you can easily implement a feature that redirects to a specific tab after

I have a webpage featuring 3 tabs. I am trying to set up the page so that it redirects to the same tab that was active before the reload. I assume each tab should append a string to the URL, like #menu1 or #menu2, but I'm having trouble implementing t ...

Styling text of various sizes to appear together in a div container

I'm having trouble getting my text to align in a single line. I've tried using vertical-align: middle and vertical-align: bottom... Can someone please assist me? http://jsfiddle.net/2wDEw/ Here is a simple example of what I have: ...

Button click does not trigger Ajax function

I've been staring at this all morning and I just can't seem to locate the source of the problem... This code involves javascript/ajax $('#subscribe').live('click', function(){ rel = $(this).attr("rel"); datas ...

Managing primary and secondary color schemes within Material Design Components for Web - a complete guide

Exploration I delved into the realm of Material Components (MDC) for Web and found myself utilizing CDN for hosted CSS and JavaScript libraries: https://unpkg.com/material-components-web@latest/dist/material-components-web.min.css https://unpkg.com/mate ...

How to select the final td element in every row using JQuery or JavaScript, excluding those with a specific class

I am looking for a solution with my HTML table structure: <table> <tbody> <tr> <td>1</td> <td>2</td> <td class="treegrid-hide-column">3</td> < ...

Ways to display Div contents based on selected options in an Angular 2/4 list

"Struggling with dynamically displaying div contents" Situation:- I have a list of 3 items: *Menu1 *Menu2 *Menu3 and I have separate div contents for each of these menu items. Requirement :- By default, Menu1 should be displayed. When Menu2 is clicked, ...

Develop interactive card collections in Bootstrap that adapt to different screen sizes

I am currently working on developing a responsive card deck using Bootstrap. The goal is to have the card deck display one card per row on mobile, 2 cards per row on tablet, and 3 cards per row on desktop. Below is the snippet of the code I am using: < ...

Show just a single picture within a container

I am working on displaying an image that I want to loop through from a folder. <div class="blah"> <% System.IO.FileInfo[] files = new System.IO.DirectoryInfo(Server.MapPath("/MyPath/")) .GetFiles(); var exefiles = from System.IO.FileInfo f in fil ...

Styling elements using the nth-child selector in JavaScript

I am trying to apply a CSS class based on the combined height of the 2nd and 3rd child elements. For example, if the height of the 2nd child plus the height of the 3rd child equals a certain value, I want to add a specific class. Here is my JavaScript cod ...

Incorporating navigation controls into a modal window

I have successfully created a sign-in modal, but now I'm looking to include buttons at the top. One button should redirect users to register/sign up, and the other button should lead them back to the sign-in modal, as shown in the image I've link ...

Turn off autocomplete feature for forms using React and Material UI

I've been diving into React and Material UI to enhance my web development skills. While working on a web form, I encountered an issue where Chrome autofills the text fields with previous data and changes the background color to yellow upon page load. ...

Using Rails to display a set of partials generated by a presenter function

Currently engrossed in watching Railscast on presenters, I find myself eager to refactor one of my presenters to incorporate the page template. The specific screencast that caught my attention is 287-presenters-from-scratch Following the suggested method ...

Change the `display: none` of elements back to their original value

Explanation In my coding practice, I have implemented a script that hides certain elements if the user lacks the necessary permission to interact with them. To achieve this, I utilize the CSS property display: none. However, when it comes time to reveal ...