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

  • Home
  • SEARCH
  • 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 6795833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:23:39+00:00 2026-05-26T18:23:39+00:00

Hello fellow stackies, I’m developing a site and I have a small problem. It’s

  • 0

Hello fellow stackies,

I’m developing a site and I have a small “problem”. It’s not that important, the site works but it’s just one of those annoying things that u keep scratching ur head about over and over.

What I’m trying to do is mix static height with dynamic height.

Example:

HTML:

< HTML >
< BODY >
< DIV class="header_with_menu" >
< /DIV >
< DIV class="main_content" >
< /BODY >
< /HTML >

CSS:

body{ margin: 0; padding 0;
width: 100%; height: 100%; }

.header_with_menu {display: block; margin-left: 100%; margin-right: 100%; height: 160px; }
.main_content {display: block; margin-left: 100%; margin-right: 100%; height: 80% }

As u can see, nothing fancy. I use a custom scrollbar javascript on main_content.
It works fine until I start screwing with the window height of firefox (or any other browser).

What I expect: When I make the window of firefox smaller and smaller, main_container will get smaller and smaller, but, remain inside of the firefox window (since it’s height is dynamic, it will simply adjust because it’s cool.)

What happens: The height of main_container will eventually get stuck at a certain height, which I don’t specify, and content will start disappearing out of view at the bottom of the browser window.

I want main_content to stay inside of the viewscreen and auto adapt to the height of the browserwindow.

How do I do this??

It’s annoying when you have a smaller monitor with just 768 px of height and about 10px fall outside of the scrollable area… And the worst thing is, I can’t seem to get it behave on my own. I’ve tried making things absolute, they just overlap each other and now way stopping that since they’re both absolute and outside of normal flow. I’ve tried experimenting with maximum and minimum heights in percentages for both header and only container… didn’t work. Searched for javascript to auto-fiddle with my css’ height or max-height percentage, didn’t work out too well…

basically i’ve been sparing with this for two days now and I’m just not creative enough to come up with some solution.

Is there a pure css solution for this?

(P.S. I’m using 77% height now for main_content since that seems to be the perfect border: not too small for 1920×1080, and not too large so content will start to disappear @ 1440×900. 78% will make content start disappearing and below 75% just makes it seem ugly at 1920×1080.)

  • 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-05-26T18:23:39+00:00Added an answer on May 26, 2026 at 6:23 pm

    I’m sorry for answering my own question, but the answer is: use a flow layout with a script that calculates the space to the bottom of the screen using percentages calculated by the current width and height of the window, to calculate the height of the content and/or footer div.

    If I have time I’ll post the script here as an edit.

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

Sidebar

Related Questions

Hello my fellow programmers, I have a problem (other than not knowing enough) I
Hello fellow Computer People! I could do this myself, but was just wondering if
Hello Fellow Computer People! Anyone willing to help will have my gratitude ;) Just
Hello fellow computer people :) I have a shell script that I will use
Hello fellow programmers. I have a SQL Server 2005 query that is taking a
Oh hello there, fellow SO members, I have a web service that returns XML
hello fellow java developers. I'm having a bit of an issue here. I have
Hello fellow drupalers, I have a question about ajax loaded views. Lets say i
Fellow JQuery hackers, hello :-) Suppose you have the following code: $('.links').click(function(){ //Do something
Hello fellow programmers I have been searching the internet for a few days now

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.