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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:15:27+00:00 2026-05-14T00:15:27+00:00

I believe this is a beginner’s CSS question. I am utilizing the method described

  • 0

I believe this is a beginner’s CSS question. I am utilizing the method described in http://www.xs4all.nl/~peterned/examples/csslayout1.html to fix a header to the top and a footer to the bottom.

What I’d like to achieve now is two columns inside the content div. A left one of 200px and a right one that takes up the rest of the width.

Unfortunately, I can’t get the left and right divs to display correctly: they just don’t grow vertically, and if I make the right div “width: 100%” it positions itself underneath the left one.

What is the trick to make the left and right div take up all the space within the content div?

The layout1.css is the original one. I just added two entries: #left and #right

layout1.css:

/**
 * 100% height layout with header and footer
 * ----------------------------------------------
 * Feel free to copy/use/change/improve
 */
html,body {
    margin: 0;
    padding: 0;
    height: 100%; /* needed for container min-height */
    background: gray;
    font-family: arial, sans-serif;
    font-size: small;
    color: #666;
}

h1 {
    font: 1.5em georgia, serif;
    margin: 0.5em 0;
}

h2 {
    font: 1.25em georgia, serif;
    margin: 0 0 0.5em;
}

h1,h2,a {
    color: orange;
}

p {
    line-height: 1.5;
    margin: 0 0 1em;
}

div#container {
    position: relative; /* needed for footer positioning*/
    margin: 0 auto; /* center, not in IE5 */
    width: 750px;
    background: #f0f0f0;
    height: auto !important; /* real browsers */
    height: 100%; /* IE6: treaded as min-height*/
    min-height: 100%; /* real browsers */
}

div#header {
    padding: 1em;
    background: #ddd url("../csslayout.gif") 98% 10px no-repeat;
    border-bottom: 6px double gray;
}

div#header p {
    font-style: italic;
    font-size: 1.1em;
    margin: 0;
}

div#content {
    padding: 1em 1em 5em; /* bottom padding for footer */
}

div#content p {
    text-align: justify;
    padding: 0 1em;
}

div#footer {
    position: absolute;
    width: 100%;
    bottom: 0; /* stick to bottom */
    background: #ddd;
    border-top: 6px double gray;
}

div#footer p {
    padding: 1em;
    margin: 0;
}

// added the following:

div#left {
   border: 1px solid red;
   width: 200px;
   float: left;
   min-height: 100%;
   height: 100%;
   padding-left: 10px;
   margin-right: 10px;
}

div#right {
   border: 1px solid blue;
   float: left;
   min-height: 100%;
   height: 100%;
   padding-left: 10px;
   margin-right: 10px;
}

layout.html:

    <!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" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>CSS Layout - 100% height</title>
    <link rel="stylesheet" type="text/css" href="layout1.css" />
</head>
<body>

    <div id="container">

        <div id="header">
            <h1>header</h1> 
        </div>

        <div id="content">
                   <div id="left">
                       left column
                   </div>
                   <div id="right">
                       right column
                   </div>
        </div>

        <div id="footer">
            <p>
                footer
            </p>
        </div>
    </div>
</body>
  • 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-14T00:15:28+00:00Added an answer on May 14, 2026 at 12:15 am

    The way I usually do it is by using the float and padding properties.

    HTML:

    <div id="leftCol">
       content
    </div>
    <div id = "rightCol">
       content
    </div>
    

    CSS:

    #leftCol {
        width: 200px;
    }
    
    #rightCol {
        width: 100%;
        float: right;
        padding-left: 200px;
    }
    

    Should work.

    So you are using float, and padding to put the div’s side by side.

    You might need:

    position: absolute;
    top: 0px;
    right: 0px;
    

    in your #rightCol CSS style (Not tested btw… from memory)

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There's a proppage.dll and an x64/proppage.dll and you'll need to… May 14, 2026 at 9:12 pm
  • Editorial Team
    Editorial Team added an answer You will have to assign a key to the command… May 14, 2026 at 9:12 pm
  • Editorial Team
    Editorial Team added an answer You can do something like this: $(window).load(function() { $(".image p.caption").each(function()… May 14, 2026 at 9:12 pm

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.