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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:52:57+00:00 2026-05-14T03:52:57+00:00

I want to have a 2 column layout, and have the left column able

  • 0

I want to have a 2 column layout, and have the left column able to be 200 px at first, and have a “shrink” button to shrink it down to 10px, and have the right column expand to fill all the rest of the available space. Then if they click on the “show” button (which will be all they see in the now 10px wide left column) have the left grow back to 200px and have the right column shrink by that amount.

I can’t figure out how to make the right column grown and shrink without knowing the exact width of the window.

I hope this makes sense, and I really hope someone can point me in the right direction.

Browser requirements are IE8, FF3.6, Safari, and Chrome, so in theory I can use some advanced CSS techniques. At least I don’t have to support IE6.

  • 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-14T03:52:57+00:00Added an answer on May 14, 2026 at 3:52 am

    Something like this should do the trick:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
        <head>
            <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
            <title>Demo</title>
            <style type="text/css" media="screen">
                html, body { height:100%;}
                #container { overflow:hidden; height:100%; }
                #sub-content { background:yellow; float:left; height:100%; width:200px; }
                #main-content { background:red; height:100%;}
                #container .shrink { width:10px; }
            </style>
        </head>
        <body>
            <div id="container">
                <div id="sub-content">
                    Sub content
                    <a id="toggler" href="#">Toggle</a>
                </div>
                <div id="main-content">
                    Main content
                </div>
            </div>
        </body>
        <script type="text/javascript">
            var link = document.getElementById('toggler');
            link.onclick = function() {
                var subContent = document.getElementById('sub-content');
                if (subContent.className == 'shrink') {
                    subContent.className = '';
                } else {
                    subContent.className = 'shrink';
                }
                return false;
            }
        </script>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MasterPage that is two column layout, left column menu, right column
I have a two-column layout and I want the left column to stay put
I want to create a 3-column layout with fixed-width left and right column, and
I have a 3 col layout (fixed center, var Left & Right side cols)
I have a 3 column layout using table-less design. <div id=main> <div id=left></div> <div
I have standard page layout: header + 2 blocks (left and right). Code are
I have a three column layout nested within a row. I want to add
I want to make a two column layout using DIVs, where right column will
I have a simple 2-column CSS layout with floated divs. The LEFT column has
I want to have CListCtrl.EditLabel() for any column of the list. How can I

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.