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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:16:46+00:00 2026-06-15T16:16:46+00:00

I have a site that at its top level, has 4 center columns, all

  • 0

I have a site that at its top level, has 4 center columns, all of equal width across a 960 grid pixel stage. If a certain query string is added to the URL, the number of columns (including content inside of course) can shrink down to 1 (never less than 1 never greater than 4).

For example:

http://www.site.com

will show all 4 columns. Going to:

http://www.site.com?col=3

will the site but without the fourth column altogether. The idea continues on. What I am struggling with, is, in the presence of a query string (managed by PHP) is it possible to allow the other columns to “auto” correct their width to maintain the entire width of the page.

SO:

  • IF 4 columns, all columns are 220px with 10px margin on each side.
  • IF 3 columns, all columns are 300px with 10px margin on each side
  • IF 2 columns, all columns are 460px with 10px margin on each side
  • IF 1 column, it is 940px with 10px margin on each side

I want to achieve this but dynamically and hopefully within one general CSS class if possible.

Update

It seems the consensus answer is to use a liquid based format (which I assumed but since the current project is built was hoping for a possible hack I may have been unaware of).

  • 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-15T16:16:47+00:00Added an answer on June 15, 2026 at 4:16 pm

    The flexible box model is the way to go here. See this codepen to see it in action.
    If you don’t want to support IE < 10 you can just use it (prefixed).

    CSS:

    .wrapper {
      display: box; //this property needs prefixes
      width: 960px;
      height: 100px;
      margin: 10px;
      background: red;
    }
    
    .box {
      box-flex: 1; //this property needs prefixes
      height: 100px;
      background: green;
      margin: 0 10px;
    }
    

    HTML:

    <div class="wrapper">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>  
      <div class="box"></div>  
    </div>
    
    <div class="wrapper">
      <div class="box"></div>
      <div class="box"></div>
      <div class="box"></div>  
    </div>
    
    <div class="wrapper">
      <div class="box"></div>
      <div class="box"></div>
    </div>
    
    <div class="wrapper">
      <div class="box"></div>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQModal window on my site that has its content populated by
I have used my local iis to test the site and now that its
I have a MOSS web site with its virtual directory in IIS. That VD
I have a paging control on my site that has it's container element set
I have a site that i want to redirect all requests accept for 1
I have a site that allows download or streaming of mp3 files. All the
I have a site that has an Rss feed, and this feed is consumed
I have a site that has a /sites/default/files/ directory where user content is typically
I have Java code that works on my desk top...its a simple app that
We have a hosted site that has a CMS we built running on a

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.