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

  • Home
  • SEARCH
  • 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 8508009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:02:11+00:00 2026-06-11T03:02:11+00:00

I have a very basic two column layout. The first column has a background

  • 0

I have a very basic two column layout. The first column has a background color of white, the second is green. I’m doing it very simply via:

#col1 { 
  background-color: white; 
  float: left; 
}

#col2 { 
  background-color: green
}

<div id="col1">

</div>
<div id="col2">
  <!-- green background, and needs to fill up the remaining width, so i can't float left */ 
</div>

Why does column two span across the entire width of the page and sit behind column one? I’d just like two columns, one of a fixed width, the second one to use up the rest of the page.

Seems so simple. Is there a better way to do this?

Here’s a fiddle:
http://jsfiddle.net/yrkrJ/1/

  • 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-06-11T03:02:13+00:00Added an answer on June 11, 2026 at 3:02 am

    Because you define float to your first DIV. So, the second div is not recognized the height. Write like this

    #col2 {
        overflow:hidden;
    }
    

    Check this http://jsfiddle.net/yrkrJ/4/

    Read this for more http://www.quirksmode.org/css/clearing.html

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

Sidebar

Related Questions

I have a very basic page with two elements, an outer green box, and
I have a Rails-based site with a basic two-column layout. On the right is
I have a very basic app with two ignition-remoteimageviews (RIV) in them. The app
I have a very basic API in my app which also has an index
Let's say I have these two very basic entities: public class ParentEntity { public
I have a very basic doubt here. I have two very simple C codes
I have a very basic two-page website: the home page, and an about page.
I have a VERY basic plot in R, and I'd like to solve two
I have a very basic doubt. Suppose we heve two after insert trigger TR1
Let me have two very basic objects like: public class View { public View(Controller

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.