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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:01:25+00:00 2026-06-15T22:01:25+00:00

I have a two columns layout (fluid left, fixed right). I want to put

  • 0

I have a two columns layout (fluid left, fixed right).
I want to put three divs in a row in the fluid column, so that they are centered in the wrapper while there is enough space and then they should align on the left.

<div class="wrapper">
Wrapper
<div class="header">
         header
</div> 
<div class="wrapleft">       
    <div class="left">
        <div class="subwrapper">
            <div class="first">Once this reach the left border, it should stay there.</div>
            <div class="second">This one should go under the blue div when there is not enough space for two divs and stay left aligned.</div>
            <div class="third">This one should go under the blue div when there is not enough space for three divs and stay left aligned.</div>
        </div>
    </div>
</div>    
<div class="right">
        right
</div> 
    <div class="footer">
        footer
    </div>     

.wrapper{
   width: 100%;
   margin: 0 auto;
    text-align:center;
}
.header{
   float: left;
   width: 100%;
   background-color: #f4f4f4;
    text-align:left;
}
.wrapleft{
   float: left;
   width: 100%;
   background-color: #cfcfcf;
    text-align:center;
}
.left{
   margin-right: 250px;
   background-color: #afeeee;
   height: 200px;
    text-align:right;
}
.right{
   float: right;
   width: 240px;
   margin-left: -240px;
   background-color: #98fb98;
   height: 200px;
}
.footer{
   float: left;
   width: 100%;
   background-color: #f4f4f4;
}
body {
   padding: 0px;
   margin: 0px;
}

.subwrapper div {
    height: 100px;
    width:200px;
    margin: 0 auto;
    text-align:center;
    color:white;
    display: inline-block;
    vertical-align:top;
    }
.subwrapper {
width:100%;
    background:purple;
    max-width:100%;
}

.first {
    background:blue;
}

.second {
    background:green;
}

.third {
    background:red;
}
​

Here is a jsfiddle that clarify what I mean http://jsfiddle.net/notme/SZjJG/
Actually I can get the first part, but I’m not able to align the divs on the left once there is no more space.
I can’t use a mediaquery, since the widths are dynamics.

UPDATE
I try to add some pics to make things clear.

Large resolution: the three divs are centered
Large resolution

Medium resolution: the three divs fit the width
Medium resolution

Small resolution: the three divs should stay on the left side. I don’t want the left margin circled in yellow.
Small resolution

  • 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-15T22:01:26+00:00Added an answer on June 15, 2026 at 10:01 pm

    Try adding:

    .first, .second, .third {
        float:left;
    }
    

    Also add to subwrapper:

    max-width: 600px;
    display: block;
    margin: 0 auto;
    

    You need to add the “display: block” and “margin: 0 auto”, for obvious reasons. However, “max-width” needs to equal the max width of the .first, second, and .third div’s together.

    Once you add padding to the .first, .second, and .third div’s though, the widths will increase. Not sure if you knew that or not. So you might want to add “box-sizing: border-box;” to your .first, .second. and .third div’s CSS.

    Example: http://jsfiddle.net/SZjJG/17/

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

Sidebar

Related Questions

I have a fluid width layout. Left and right column have a fixed width
I have a two column layout: http://jsfiddle.net/KqQ42/1/ Now I would like that the left
I have a two column site layout that has the content of the left
I am working on a 3-column layout with two fixed-width sidebars (left and right)
I am using Table layout. I have two(columns) text-views in table row. I want
If one uses float:left to layout two columns, does the left column have to
I want a layout with two columns, two divs, where the left one has
I want a two-column div layout, where each one can have variable width e.g.
I have two columns in my layout. I'd like the right <div> to expand
I have a two column layout set up, and I want to have both

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.