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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:10:02+00:00 2026-05-26T17:10:02+00:00

I have a client which want a css tricky solution. They want the divs

  • 0

I have a client which want a css tricky solution. They want the divs to have different widths on different occasions. Like on page 1 we have a leftnavigation, on page 2 we don’t. So the content containing divs should expand in width when the leftnavigation div is not there.

html

<div id="page">
    <div id="wrapper">
        <div class="leftnav"></div>
        <div class="contentColumnLeft"></div>
        <div class="contentColumnRight"></div>
    </div>
</div>

css

#page{width: 100%; height: 100%;}
#wrapper{margin: 0px auto; width: 960px;}
.leftnav{width: 110px; float: left;}
.contentColumnLeft{width: 500px; float: left;}
.contentColumnRight{width: 200px; float: left;}

When the .leftnav is not there (gets removed with jquery when page url contains parameters ?lnav=t) it leaves a wide gap open on the right side of the #wrapper div which I want to close.

Can this be solved CSS wise or is jquery a valid second option?

  • 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-26T17:10:03+00:00Added an answer on May 26, 2026 at 5:10 pm

    Use display: table; and display: table-cell;

    #wrapper{display: table;}
    .leftnavn{display: table-cell;}
    .contentColumnLeft{display: table-cell;}
    .contentColumnRight{display: table-cell;}
    

    Then when the leftnav gets removed from inside the #wrapper, the others will always take up the remaining space.

    Check out this demo to see it in action.

    Click the .leftnavn div to see the other two divs take up the remaining space.

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

Sidebar

Related Questions

I have a HTML page with which I want to do some client side
I want to achieve a form using css which have different panels for different
I want to create an application which will have a client and server components.
I have a client and a host program (written in c) which I want
I have a client which is shipping via UPS, and therefore cannot deliver to
I have a client which makes a limited number of concurrent web requests. I
I need some help about WCF and authorization. Currently I have a client which
I have a python client which pushes a great deal of data through the
I have an object (Client * client) which starts multiple threads to handle various
I have client and server programs which now communicate via TCP. I'm trying out

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.