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 4024388
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:42:57+00:00 2026-05-20T10:42:57+00:00

I have the following problem. I have done the following: In my css file,

  • 0

I have the following problem.

I have done the following:

In my css file, I have declared both for body and for a div tag enclosed in body, height: 100%; (the div tag is technically a <asp:panel> tag, but get’s rendered as a div tag.

This works fine, and the div container scale to fill the browser from top to bottom, and does not give any scrollbar, just as it is intended to.

However, on one of the sub-pages, from the Page_Load method I add some controls to the panel/div, and those controls are enough to fill more than the height of the screen, and therefore a vertical scrollbar is given as it should. However, when I start scrolling, the part of the content that was originally below the height of the screen do not get any background. So the background is still constrained to the max height of the screen even if it’s contents are exceeding that height.

I assume that the height:100% causes the problem here, but I have not found a replacement that works as it should in this case. I tried height:auto; causing the background to be removed in it’s entirety.

The question might be basic, but I do not do much web programming these days, so please bear with me 🙂

EDIT

As additional information, I should mention that the content is actually added inside a div inside the original div if that matters.

EDIT 2

Some of the relevant html and css:

<html>
<title></title>
<body>
  <form>
    <div class="MainContainer">
      <h1>My header</h1>
      <div class="MainMenu">
        ...
      </div>
      <div id="PageContents_BlogPostPanel" class="ContentContainer">
        ...(These are the contents that extend beyond the bottom of the page)!!
      </div>
    </div>
  </form>
</body>
</html>

And here is the extracted css parts:

*
{
    margin: 0;
    padding: 0;
}

html, body
{
    background-color: #6CC66C;
height: 100%;
} 

form
{
    background: #6CC66C url(  'images/ShadowBackground.jpg' ) repeat-y top center;
    height: 100%;
}

body h1
{
    display:none;
}

.DivHeader
{
    font-family: Arial, Sans-Serif;
    font-size: 22px;
    color: #D04444;
    padding-top:20px;
    padding-bottom:10px;
}

p
{
    font-family: Arial, Sans-Serif;
    font-size: 16px;
}

a
{
    font-family: Arial, Sans-Serif;
    font-size: 16px;
    text-decoration: none;
}   

.MainContainer
{
    background: #6CC66C url( 'images/MainBackground.jpg' ) no-repeat top center;
    width: 1040px;
    height: 100%;
    margin: auto;
    background-color: #F7F7F7;
}

div.MainMenu
{
    position:relative;
    float: right;
    margin-right: 38px;
    margin-top: 103px;
    width: 495px;
}

.MainMenu a:link img, a:visited img { border: 0px; }

.ContentContainer
{
    float: left;
    margin-top:90px;
    margin-left:80px;
    width:550px;
}
  • 1 1 Answer
  • 1 View
  • 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-20T10:42:57+00:00Added an answer on May 20, 2026 at 10:42 am

    I have a solution for this and it’s rather simple. 🙂

    .MainContainer {
        ...
        display: table;
    }
    

    (Remove the height: 100% from elsewhere too, it’s redundant.)

    Some spec info on that: http://www.w3.org/TR/CSS2/tables.html also here: w3schools.com/css/pr_class_display.asp (Apparently I can only post two links a new user right now)

    Regarding the use of Height: 100%, doing that will only make the elements height equal to the height of it’s parent element – in this case the document window, not the contents of it.
    Some spec info here: http://www.w3.org/TR/CSS21/syndata.html#percentage-units

    Regards.

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

Sidebar

Related Questions

I have following problem. I want to create a file system based session storage
I think this is a typical problem. I have following html <div class=editor-label>Group Name:
I have following problem that in a transformation (which is completely done in memory)
I have following problem: I have to make a ASP.NET Webapplication with a two-row
I have following problem: I have built a tabbar application with 4 tabs. I
I have following problem, Code: String a=Yeahh, I have no a idea what's happening
Hi i have following Problem. I write a Mediawiki Extension where i need some
I am using GWT/JAVA for development. I have following problem: I want to remove
I have the following problem. I have embedded a map using Google Maps' API.
I have the following problem in Cakephp: I maded a CMS to edit the

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.