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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:50:29+00:00 2026-06-07T19:50:29+00:00

I dont want to use JS for this, only a css solution please .

  • 0

I dont want to use JS for this, only a css solution please.

I want the columns inside of a containing div to fit inside equally i.e each one is a third of the width of the container. I have achieved this here – http://jsfiddle.net/yFxZX/

However, on top of this, I also want 10px margin between the columns, with the first column kissing the left edge of the container, and the right column kissing the right edge of the container. see image below for crude mock up.

As the browser is re-sized or parent container changes width I want the columns to resize accordingly to fill the space but the margins between them to remain fixed at 10px.

Can this be done without JS?

enter image description here

  • 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-07T19:50:32+00:00Added an answer on June 7, 2026 at 7:50 pm

    Use negative margins:

    .container {
      background: green;
      overflow: auto;
    }
    
    .inner {
      padding-left: 20px;
    }
    
    .box {
      width: 33.3%;
      background: red;
      float: left;
      margin-right: 10px;
    }
    
    .first {
      margin-left: -20px;
    }
    
    .last {
      width: 33.4%;
      margin-right: 0;
      /*float:right;*/
    }
    
    img {
      max-width: 100%;
      height: auto;
      width: auto\9;
      /* ie8 */
    }
    

    http://jsfiddle.net/yFxZX/2/

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

Sidebar

Related Questions

http://jsfiddle.net/L2yLe/ The fiddle says it all. I want a css-only solution that limits the
How to do it? I don't want to use this: HttpContext.Current.Server.MapPath Is there a
this is a post back problem (I don't want to use the client side
my question is similar to this one , but I don't want to use
I want to use many bars like this one in my app (i don't
I don't know if I can use regex for this, but I want to
I'm looking forward to use Symfony2. But i dont want to use a template
I have a placholder that I dont just want to use Visible=false on, becouse
I want to use the status method but i dont understand how it works.
Below is my HTML and CSS. I want to use javascript to determine when

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.