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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:45:34+00:00 2026-05-26T00:45:34+00:00

I have never thought that writing a simple two column layout is so complicated

  • 0

I have never thought that writing a simple two column layout is so complicated using css….haha

What I want to do is the following:

  1. When the height of the content div exceed the height of screen size, scroll bar exist only in the content div. The users can only scroll the content div but the sidebar keeps static

  2. The two columns should have the same height

    My layout is:

<—————container——————->

<——————-header——————>

<—–sidebar——-><———content—>

<——————footer——————->

<—End of container————————->

Here is my css file:
http://137.189.145.40/c2dm/css/main.css

  • 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-26T00:45:34+00:00Added an answer on May 26, 2026 at 12:45 am
    #WorldContainer
    {
         width: 1000px;
         margin: auto;
         overflow: hidden;
    }
    
    .ContentColumn
    {
         float: left;
         width: 500px;
         overflow: auto;
    }
    
    <div id="WorldContainer">
       <div class="ContentColumn">
            Content goes here!
       </div>
       <div class="ContentColumn">
            Content goes here!
       </div>
    </div>
    

    That will give you a page where the main div cannot scroll but the two div columns can. They will be side by side. You question wasn’t exactly clear so hopefully this is what you were after.

    EDIT: In response to you showing the example site.

    Your problem is really simple.

    All of your divs have a height rule of height: 100%;
    When you use percentage height, you are making it a percent of the container it is within, i.e Its parent container. It is NOT a percentage height of the entire window.

    Every container is specifying a percentage height so the result is a height of 0.
    Give your outermost div a fixed height and the problem will be resolved.

    Additional Edit:

    If you are concerned with making sure the outermost div always stretches to the bottom of the window then this is a css solution using absolute positioning:

    #OutermostDiv
     {
        position: absolute;
        top: 0;
        bottom: 0;
     }
    

    Using this approach still causes a calculated height even though the outer div doesn’t have a hard coded height. This will allow you to use percentage heights on your inner divs and maintain a outer div that stretches from top to the bottom of the visible window.

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

Sidebar

Related Questions

Never thought I'd have this problem :) The following snippet of code works in
I have an odd question that I have always thought about, but could never
I have never thought about until recently, but I'm not sure why we call
I have zero experience with COM. I actually never thought, I'll need to do
I never actually thought I'd run into speed-issues with python, but I have. I'm
I do not currently have this issue , but you never know, and thought
I have a process, let's call it Process A, that is hosting a simple
In an interview I was asked a question that I'd never thought about, which
I'm writing some user-JS for Opera. It reacts on a request that doesn't have
I have never worked with web services and rails, and obviously this is something

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.