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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:57:16+00:00 2026-06-04T01:57:16+00:00

JSFIDDLE EDIT: Trying to achieve the opposite of this . (instead of 2 fixed-width

  • 0

JSFIDDLE

EDIT: Trying to achieve the opposite of this.
(instead of 2 fixed-width divs on the sides and one fluid-width div in the middle,
I’m trying to get 2 fluid-width divs on the sides and one div centered in the middle)

I have 3 divs: A, B, and C.

B needs to sit centered between A and C.

What I need to do

What I’m currently doing is pretty much matching what’s going on above. But, if A, B, and C’s container has an odd width, some browsers are rounding A and C’s widths down and others up (leaving C 1px too long and 1px too short, respectively).

notice the extra pixel to the right of C


notice the space to the right of C is a pixel thinner.


I don’t care how many nested divs I need, but I’ve been spending way too much time on this! If someone already has a sure-fire solution to this problem, please share!

notes:
– A, B, and C’s parent can’t have overflow hidden.
– A, B, and C can’t overlap (they have translucent png’s)

This is my starting point: JSFIDDLE

  • 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-04T01:57:17+00:00Added an answer on June 4, 2026 at 1:57 am

    Here are two ways that work, both with caveats (warning, both require a wrapper):

    HTML

    <section class="wrapper">
        <div class="column" id="a"></div>
        <div class="column" id="b"></div>
        <div class="column" id="c"></div>
    </section>​​​​​​​​​​​
    

    Base CSS

    .column {
        height: 3em;
    }
    
    #a {
     background-color: red;   
    }
    #b {
     background-color: green;
    }
    #c {
     background-color: blue;   
    }
    
    #b {
      width: 50px;   
    }
    

    CSS3 Approach:

    .wrapper {
        display:box;
        box-orient:horizontal;
        box-align:stretch;    
    }
    
    #a, #b {
        box-flex:1.0;
    }
    

    Caveat: Only supported (so far) in Firefox and Webkit (Chrome/Safari), both requiring prefixed rules. The above is what it will be someday.

    Here is a demo with prefixes: http://jsfiddle.net/crazytonyi/cBVTE/

    Table-Display approach

    .wrapper {
        display: table;
        width: 100%;
        table-layout: fixed;
    
    }    
    .column {
        display: table-cell;
    }
    

    Caveats: IE didn’t start supporting this display type until 7 or 8. On the other hand, worrying about users on older versions of IE is like worrying about people who still turn off cookies and javascript. Either they catch up or get used to pages breaking. End the pandering!

    Here’s a demo using the above: http://jsfiddle.net/crazytonyi/kM46h/

    In both cases, no floats or positioning needed, just willingness to give the middle finger to older browsers. How old depends on which method you choose.

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

Sidebar

Related Questions

This is what I'm trying to achieve I have a fluid tooltip and a
I'm trying to achieve a basic fixed table header effect. For this I'm using
jsfiddle is here: http://jsfiddle.net/M86nA/ code is this: $('div.wrap').click(function(){ var $minY = $('div.imgur-wrap').height(); if ($minY
I am trying to see if its possible to achieve this kind of shadow
jsFiddle I'm trying the get the ID of a button using $(this).id , but
Edit for vhinn I want it to look like this: I am trying to
I m trying to achieve this as seen in the first image. There is
Wonder if anyone could shed some light on this http://jsfiddle.net/orbitalmedia/ZrxBb/7/ Basically I'm trying to
I'm trying to edit this js code so that the autocomplete function kicks in
I'm trying to create a div containing 3 different divs: the header, the content

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.