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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:45:30+00:00 2026-05-28T01:45:30+00:00

I need to style two columns dynamically. They should have a width of 50%

  • 0

I need to style two columns dynamically. They should have a width of 50% each, but a fixed gap of 10px between them.

When I collapse my menu the columns should widen to the space available and the gap should remain 10px. Because of this a can’t take a fixed width for the columns.

I tried this:

#container {
  background: red;
  width: 100%;
  height: 20px;
  padding: 0 -5px;
}
.column {
  height: 20px;
  float: left;
  width: 50%;
}
#left {
  background: green;
  margin-left: -5px;
}
#right {
  background: blue;
  margin-right: -5px;
}
#space {
  width: 10px;
  float: left;
  height: 20px;
}
<div style="width:400px; border:1px solid black">
  <div id="container">
    <div id="left" class="column"></div>
    <div id="space"></div>
    <div id="right" class="column"></div>
  </div>
</div>

But then the blue and the green divs expand over the outer div with the black border.

This is what it should look like. Any chance that i can set a relative height for the columns or am i forced to use javascript when collapsing my menu?

  • 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-28T01:45:31+00:00Added an answer on May 28, 2026 at 1:45 am

    You’ll need either tables or CSS tables.

    CSS tables should be supported by all browsers except IE7 and below.

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

Sidebar

Related Questions

I need to find a way to join two XML files when they have
i need to implement two different stylesheets in a single master page. one style
I need to style a table to have rounded corners. I'm just looking at
I have a grid named 'GridView1' contains two columns 'Date' and 'Session Details' I
I have two tables, each one has a primary ID column as key. I
I have a question about database 'style'. I need a method of storing user
I need the content to flow in two coloumns and I dont have the
Situation: I have two fixed-height divs, overflow set to hidden on both, and dynamic
So i have this code that creates two windows: WNDCLASS wc; wc.style = CS_BYTEALIGNCLIENT
I have two simple tables let's say country and state . Suppose, I need

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.