Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8416391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:44:28+00:00 2026-06-10T01:44:28+00:00

So, I’ve been stuck with this problem for a while now and I can’t

  • 0

So, I’ve been stuck with this problem for a while now and I can’t seem to find a solution.

I’m trying to make a layout consisting of (for now) 4 different content areas like so:
Basic layout

What I’m trying to do

I’m trying to do the following things:

Simple explanation: Content should be the only scrollable thing on the page, with the footer following right behind it if content fits on the page, fixed on the bottom otherwise.

Detailed explanation:

  • Fix banner and mainMenu so that they never move when page is scrolled.
  • Make the content scroll with a page so that:
    • If the content (and footer) fit on a page, no scroll is displayed.
    • If the scroll is needed, content goes behind the banner (not being shown) and does not appear again above it.
    • If the scroll is needed, content can scroll until the bottom line of it and the footer are in the visible area.
  • The footer should do two things:
    • If content and footer fit on the page, footer should stick at the bottom of the content
    • Otherwise, footer should be fixed on the bottom.

What I have tried

Fixing banner,mainMenu and the footer are fixed using position: fixed (and positioned accordingly). Parent div has overflow: hidden (which doesn’t seem to work).

<div id='main'>
  <div id='banner'>banner</div>
  <div id='mainMenu'>mainMenu</div>
  <div id='content'>.. some long content ..</div>
  <div id='footer'>footer</div>
</div>

And

#main {
  width: 960px;
  height: auto;
  margin: 40px auto;
  overflow: hidden;
}
#main #banner {
  width: 960px;
  height: 100px;
  position: fixed;
}
#main #mainMenu {
  width: 230px;
  height: auto;
  display: inline;
  float: left;
  position: fixed;
  top: 140px;
}
#main #content {
  width: 720px;
  height: auto;
  display: inline;
  float: right;
  margin-top: 100px;
}
#main #footer {
  width: 960px;
  height: auto;
  clear: both;
  position: fixed;
  bottom: 0;
}

The Problem

Footer does not follow content if it fits within the area
Footer does not follow content
Content overflows on the top of banner
Content overflows over banner

I would really prefer to do this just in CSS (if possible) and as compatible as possible (IE7+, all other major browsers).
It’s really getting frustrating now.. Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:44:30+00:00Added an answer on June 10, 2026 at 1:44 am

    There is no conceivable way I can think of that would solve your problem by just using css. Once you have set your elements to a fixed position they are out of the flow and thus your other elements cannot conform around them.

    However I did find a solution by doing two different things. For the header issue I simply added another fixed element above the main banner and set it to the color of the background. This way the content will scroll behind it and look as if it is hidden. For the footer, I set up some javascript using jQuery to see if the content overflows or not. If it does then the footer’s position is set to fixed, otherwise the position is set to relative.

    You can check it all out here in this demo: http://jsfiddle.net/mrQGh/4/

    To test out the javascript simply delete the text until there is no more overflow and run it again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.