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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:57:13+00:00 2026-05-18T02:57:13+00:00

I need the following layout for a webapp: +———————————————+ | header | +——————————————-+-+ |

  • 0

I need the following layout for a webapp:

+---------------------------------------------+
|                   header                    |
+-------------------------------------------+-+
|                                           |#|
|                   content                 | |
|                                           |#|
+-------------------------------------------+-+
|                   footer                    |
+---------------------------------------------+

Header/footer should always be at the top/bottom of the browser page. They do not have a fixed height.

Content should fill the available space and optionally get a scrollbar (indicated by #). The scrollbar should not cover the whole window.

I need this to work in IE>=7, Chrome and Firefox.

So far I tried different divs and tables but they all failed because I can’t get content to exactly fill the available space.

Updated:
The height of header and footer should be determined by their own content (e.g. header might include a menu, footer a notification set by javascript).

Added sample:

This should show what I am trying to do. The problem is (apart from not working 🙂 ) is that the height of the ‘outer’ div is greater than the window.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%">
<head>
  <script src="../lib/jquery-1.4.2.min.js" type="text/javascript"></script>
  <style type="text/css">
    .header { width: 100%; background-color: red; }
    .footer { width: 100%; background-color: blue; }    
    .content { overflow: auto; height: 100%; }
  </style>
    <script type="text/javascript">

      $(function ()
      {
        $("#grow").click(function () { var a=$("<div>test</div>").hide(); $(".header").append(a); a.slideDown(); });
        $("#toggle").click(function () { $("#text").toggle(); });
      });

  </script>
</head>
<body style="height: 100%">
  <div id="outer" style="height: 100%">
    <div class="header">
      header <a id="grow" href="#">grow</a>
    </div>
    <div class="content">
      <h3>
        Lorem:</h3>
      <p>
        <a id="toggle" href="#">toggle</a>
      </p>
      <p id="text">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam faucibus, nisl nec egestas molestie, orci quam adipiscing
        neque, ut luctus ante lorem non enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
        Donec neque urna, euismod nec eleifend nec, imperdiet id nunc. Sed id orci sed magna varius rhoncus eget quis nulla. Aliquam
        posuere erat ut leo suscipit adipiscing. Integer tortor sapien, ornare in cursus sit amet, facilisis eget enim. Duis leo
        nulla, fringilla eget vestibulum vel, pretium ut purus. In dictum vulputate risus, eu fringilla urna malesuada eu. Cras
        interdum sollicitudin volutpat. Sed eu iaculis dui. Praesent eleifend sem a urna viverra ullamcorper. Vivamus iaculis volutpat
        mauris, sed ornare diam laoreet vitae. Aenean cursus dui vitae mauris tempus pulvinar. Morbi pharetra rutrum eros sed luctus.
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam faucibus, nisl nec egestas molestie, orci quam adipiscing
        neque, ut luctus ante lorem non enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;
        Donec neque urna, euismod nec eleifend nec, imperdiet id nunc. Sed id orci sed magna varius rhoncus eget quis nulla. Aliquam
        posuere erat ut leo suscipit adipiscing. Integer tortor sapien, ornare in cursus sit amet, facilisis eget enim. Duis leo
        nulla, fringilla eget vestibulum vel, pretium ut purus. In dictum vulputate risus, eu fringilla urna malesuada eu. Cras
        interdum sollicitudin volutpat. Sed eu iaculis dui. Praesent eleifend sem a urna viverra ullamcorper. Vivamus iaculis volutpat
        mauris, sed ornare diam laoreet vitae. Aenean cursus dui vitae mauris tempus pulvinar. Morbi pharetra rutrum eros sed luctus.
        Vestibulum consequat vestibulum neque. Donec sagittis nisl sed sem dapibus accumsan. Praesent at ipsum enim. Nullam tellus
        sem, lobortis aliquet aliquet nec, volutpat vitae felis. Fusce dui leo, elementum sit amet varius sed, dictum non enim.
      </p>
    </div>
    <div class="footer">
      footer
    </div>
  </div>
</body>
</html>
  • 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-18T02:57:13+00:00Added an answer on May 18, 2026 at 2:57 am

    In the end I had to use Javascript in combination with the resize event:

    <html>
    <head>
      <script type="text/javascript" src="~/Scripts/jquery-1.4.2.min.js"></script>
      <script type="text/javascript">
        $(function ()
        {
          var resize=function () { $(".dynamic-y").each(function (i, x) { $(x).height($(window).height()-$(".footer").outerHeight()-$(x).offset().top); }); };
          $(window).resize(resize);
          resize();
        });
      </script>
    </head>
    <body>
      <div class="header">
        ...
      </div>
      <div class="page dynamic-y">
        ...
      </div>
      <div class="footer">
        ...
      </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build a HTML/CSS layout with the following layout |Static Div|Content Div0|Content
I need following layout in Java: However, I should find that no layout manager
I need to create the following layout: +--------+----------------------------------+-----------+ | fixed | variable | variable
I need to achieve the following interface layout: The obvious path would be a
I have the following Tab layout JsFiddle Code . Now i need to capture
I need to implement the following layout structure in some web site: As you
I have the following page layout in my application: <Grid x:Name=ContentPanel Grid.Row=1> <ScrollViewer x:Name=ScrollViewer1
I need following layout for my application: <TextView/> <ListView/> <Button/> But in this layout
I need to display the following layout with a telerik PanelBar. With the code
I need to output the following form layout: <tr><td>Label</td><td>Element</td></tr> <tr><td></td><td>ElementErrors</td></tr> This is needed for

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.