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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:34:23+00:00 2026-05-15T01:34:23+00:00

I want to achieve a simple frame layout with fixed header, fixed left navigation

  • 0

I want to achieve a simple “frame” layout with fixed header, fixed left navigation area, and a main content area that fills 100% of the remainder of the viewport with scrollbars if necessary. My best attempt is below – but when I add enough content to the main div to force scrolling, I see that the scrollbar extends below the bottom of the viewport.

What am I doing wrong? Or what is IE6 doing wrong and how can I fix it?

NB please don’t recommend using a more recent browser – I’d love to but can’t.

Update 1 (for Matti and other purists!) – I have to live within real-world constraints of developing a web application for the head office of a group which needs to be accessed by users in over 100 subsidiaries, not all of which have upgraded to a modern browser. And some subsidiaries would love to use browser incompatibility as an excuse not to use the application imposed by head office!

Update 2

I’m an application developer, not a web designer, as is probably obvious. To date I have been using a DOCTYPE HTML 4.0 Transitional which I believe forces quirks mode in all IE version. However I recently tried adding the AjaxControlToolkit ModalPopupExtender, and this messes up my layout when the popup is displayed. Google suggested I need to use XHTML 1.0 to fix this (AjaxControlToolkit doesn’t support quirks mode), and in fact I’m quite happy to move to cleaner CSS-based layout, but I do need my basic frame layout to work in IE6.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <style type="text/css">
    html, body
    {
        height:100%;
        margin:0;
        padding:0;
        overflow:hidden;
    }
    div
    {
        border:0;
        margin:0;
        padding:0;
    }
    div#top
    {
        background-color:#dddddd;
        height:100px;
    }
    div#left
    {
        background-color:#dddddd;
        float:left;
        width:120px;
        height:100%;
        overflow:hidden;
    }
    div#main
    {
        height:100%;
        overflow:auto;
    }
    </style>    
</head>
<body>
    <div id="top">Title</div>
    <div id="left">LeftNav</div>
    <div id="main">
    Content
    <p>
    Lorem ipsum ...
    </p>
    ... repeated several times to force vertical scroll...
        <table><tr>
        <td>ColumnContent</td>
        ... td repeated several times to force horizontal scroll...
        <td>ColumnContent</td>
        </tr></table>
    </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-15T01:34:24+00:00Added an answer on May 15, 2026 at 1:34 am

    In my previous answer, I was absolutely wrong (no pun intended), as you can’t specify both top and bottom in IE6, neither both left and right. Moreover, you don’t know the exact width and height of the content div, nor do you know them as a percentage of the viewport.

    When I solved this, I put IE into quirks mode, to get the border-box box model (see also W3C spec). To use the same CSS rules for more standards compliant browser, you can use the box-sizing property (and variants). After doing this, the borders get inside the contents and you can push your contents down and to the right by specifying a border (width and style):

    <!-- put IE in quirks mode -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>IE6 'frames'</title>
      <style type="text/css">
        * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
          -moz-box-sizing: border-box;
          -khtml-box-sizing: border-box;
          -webkit-box-sizing: border-box;
        }
    
        html, body {
          height: 100%;
          overflow: hidden;
        }
    
        #top {
          position: absolute;
          top: 0;
          width: 100%;
          background-color: #ddd;
          height: 100px;
          z-index: 2;
        }
    
        #left {
          position: absolute;
          left: 0;
          border-top: 100px solid;  /* move everything below #top */
          background-color: #bbb;
          width: 120px;
          height: 100%;
          overflow: hidden;
          z-index: 1;
        }
    
        #main {
          position: absolute;
          border-top: 100px solid;
          border-left: 120px solid;
          width: 100%;
          height: 100%;
          overflow: auto;
        }
      </style>    
    </head>
    <body>
      <div id="top">Title</div>
      <div id="left">LeftNav</div>
      <div id="main">
        <p>
          Lorem ipsum ...<br />
          <!-- just copy above line many times -->
        </p>
      </div>
    </body>
    </html>
    

    UPDATE: In IE >= 7 and more standards compliant browsers you can use position: fixed together with both top and bottom (et al.) rules. There is a way to get this frame-like appearance in IE6 in Standards Mode (or rather, Almost Standards Mode) using CSS expressions. This way, you can let the JScript engine calculate the correct values of width and height (added between conditional comments).

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
      <title>'Frames' using &lt;div&gt;s</title>
      <style type="text/css">
        * {
          margin: 0;
          padding: 0;
        }
    
        html, body {
          height: 100%;
          overflow: hidden;
        }
    
        #top, #left, #main {
          position: fixed;
          overflow: hidden;
        }
    
        #top {
          top: 0;
          width: 100%;
          background-color: #ddd;
          height: 100px;
        }
    
        #left {
          left: 0;
          top: 100px;  /* move everything below #top */
          bottom: 0;
          background-color: #bbb;
          width: 120px;
        }
    
        #main {
          top: 100px;
          left: 120px;
          bottom: 0;
          right: 0;
          overflow: auto;
        }
      </style>
      <!--[if IE 6]>
      <style>
        #top, #left, #main {
          position: absolute;
        }
    
        #left {
          height: expression((m=document.documentElement.clientHeight-100)+'px');
        }
    
        #main {
          height: expression((m=document.documentElement.clientHeight-100)+'px');
          width: expression((m=document.documentElement.clientWidth-120)+'px');
        }
      </style>
      <![endif]-->
    </head>
    <body>
      <div id="top">Title<br /></div>
      <div id="left">LeftNav<br /></div>
      <div id="main">
        <p>
            Lorem ipsum ...<br />
            <!-- just copy above line many times -->
        </p>
      </div>
    </body>
    </html>
    

    That said, I don’t recommend this method. It will slow down the browsing experience of the already not too fast IE6 noticeably, as these expressions are evaluated many times.

    Just one more sidenote: I suppose you’ll use external style sheets (and scripts) in the end, but if you want to embed those inside an XHTML document, use “CDATA markers and comments appropriate for the script or style language used”, as David Dorward recommends.

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

Sidebar

Ask A Question

Stats

  • Questions 409k
  • Answers 409k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One way is to do net use s: \\<share path>… May 15, 2026 at 7:13 am
  • Editorial Team
    Editorial Team added an answer This article looks perfect for you if you want to… May 15, 2026 at 7:13 am
  • Editorial Team
    Editorial Team added an answer You're unlikely to find sets of tiles that are simultaneously… May 15, 2026 at 7:13 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.