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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:46:14+00:00 2026-06-18T01:46:14+00:00

I have this HTML: <body> <div id=logo> <table id=width100 cellpadding=0 cellspacing=0 > <tr> <td

  • 0

I have this HTML:

<body>
<div id="logo">
    <table id="width100" cellpadding="0" cellspacing="0"  >
        <tr>
            <td width="33.33%" align="left">&nbsp;</td>
            <td width="33.34%" align="center"><a href="http://www.rawgameshop.com/"><img src="images/logo_new.png" /></a></td>
            <td width="33.33%" align="right"><img src="images/logo_right.png" /></td>
        </tr>
        <tr bgcolor="#731000" id="width100">
            <td height="15" colspan="3" ></td>
        </tr>
    </table>
</div>

<center>
<div id="container">
    <div id="main_body">
        asd
    </div>
</div>
</center>

And this CSS:

body {
    width:100%;
    height:100%;
    margin:0px;
    background-color:#ECECEC;
}

#logo {
    width:100%;
    height:165px;
    background-color:#FFFFFF;   
}

#width100 {
    width:100%;
}

#container {
    background-color:#FFFFFF;
    height:100%;
    width:900px;
}

#main_body {
    width:800px;
    background-color:#FFFFFF;
    height:100%;
}

My question is: why doesn’t my main_body div stretch down across the middle of the page? It is only as tall as the letters.

If I remove the <center> HTML tags it does stretch down, but at 100% screen size, that means I have to scroll down to the end. I wanted it to be to the edge of the screen, not further.

  • 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-18T01:46:15+00:00Added an answer on June 18, 2026 at 1:46 am

    height:100% takes the height of the first parent element that has a height set on it. As all your parent objects have a percentage height on it will go right up to the body and take 100% of that height.

    You will either need to set #logo as a percentage height and then your main_body as the rest of the percentage otherwise you will need javascript / jquery to resize your main_body as css hasn’t enabled a way to do calculations yet (although I think it may be coming soon)

    Have a look at this post as they were trying to achieve the same thing:

    Calculate value with CSS3

    If you are going the jQuery route you will need to add the jquery library to your page (I usually put this at the bottom of the page) and then anywhere after this you need to include your script you are going to run like so:

    <script type="text/javascript">
      $(document).ready(function () { 
        var newHeight = $(window).height() - $('#logo').height();
        var oldHeight = $('#container').height();
    
        if (newHeight > oldHeight) {
          $('#container').height(newHeight);
        }
      });
    </script>
    

    the $(document).ready(function(){}) means that anything that is within the function will be fired once the document (web page) has finished loading

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

Sidebar

Related Questions

I have a div directly under the body. My HTML looks like this: <body>
I have the following code: <html> <body> <div style=background-color: lightblue; onClick=alert(myArray[0][1])> this is a
i have this html code <table style=width: 100%;> <tr> <td> ID </td> <td> <input
Suppose I have a div area like this: <html> <head> </head> <body> <div id=logo_area
I mean I have this code: <script> $(document).ready( function() { $('html, body').animate({ scrollTop: $(.error).offset().top
I have this html table: <table class=table-all> <tbody> <tr> <td>BISFENOLO</td> <td>Bisfenolo-AF 10/10</td> <td class=right>€
I have this: HTML: <div id=selectedsongs> <a href=# rel=1>song1></a> <a href=# rel=2>song2></a> <a href=#
I have this HTML structure <div class=buttons> <button data-icon=ui-icon-disk class=save>Save1</button> <button data-icon=ui-icon-check class=ok>OK1</button> <button
I have this JSF table: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC -//W3C//DTD XHTML
I have a div in my html called logo and what I am trying

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.