Jump to content

[SOLVED] Issue with 100% height and overflow:scroll


skyer2000

Recommended Posts

Note that this layout is unlikely to work in IE6, users of IE6 and ealier are encouraged to upgrade. Those using win9x should shift to opera, or upgrade their OS which would allow them to get a new browser.

 

The following layout is position based, I'm sure you can modify it to fit your own requirements.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

  <head>
    <title>SE Friendly Absolute Positioning Example</title>

    <style type="text/css">
     html, body {
      margin: 0;padding: 0;
      height: 100%;
     }
     #Basement {
      position: relative; /* Enables positioning inside the wrapper */
      width: 75%;
      min-width: 800px;
      max-width: 1600px;
      height: 100%;
      margin: 0 auto; /* Normal way to center the Page AKA wrapper */
     }
     #Content {
      position: absolute;
      top: 135px;right: 0;bottom: 135px;
      width: 75%;
      min-width: 500px;
      overflow-y: scroll;
       background: green;
     }
     #Navigation {
      position: absolute;
      top: 135px; /* Height of the Header */
      left: 0;bottom: 135px;
      width: 25%;
      min-width: 200px;
       background: silver;
     }
     #Header {
      position: absolute;
      top: 0;left: 0;
      width: 100%;height: 135px;
      min-width: 200px;
       background: gray;
     }
     #Footer {
      position: absolute;
      bottom: 0;left: 0;
      width: 100%;height: 135px;
      min-width: 200px;
       background: gray;
     }
    </style>

  </head>

  <body>
    <div id="Basement">

     <div id="Content">
      <h1>SE Friendly Absolute Positioning Example</h1>
      <p>This is the content.</p>
     </div>

     <div id="Navigation">
      <p>Navigation</p>
     </div>

     <div id="Header">
      <p>Header</p>
     </div>

     <div id="Footer">
      <p>Footer</p>
     </div>

    </div>
  </body>

</html>

Link to comment
Share on other sites

It is actually 2008 (try copy/pasting it into notepad), when Georgia is that small the zeros look like that for some reason.

 

The absolute positioned layout is exactly what I needed, works great! To make it work you just need to define the widths (100%) of each element, then keep the container 1000px.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.