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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:56:28+00:00 2026-05-23T14:56:28+00:00

I want to make a html layout,this is the image: The whole page contain

  • 0

I want to make a html layout,this is the image:
enter image description here

The whole page contain the divs:

Head
left
main01
main02

And the control div:

toogle_bar1
toogle_bar2

Now I want to make the following effect:

1) The head take a specified height of the browser(for example 50px),and take 100% width of the browser.
2) And by default,the main02 is not visible,so the main01 div take the same height of the left and take the left width.

3) When the toggle_bar1 clicked,the left should be hide/shown,once it is not visible,the main01 (and main02 if main02 is visible) will take all the width of the browser.

4) When toggle_bar2 clicked,the main02 should be hidden/shown,once it is visible,it will take the same width as main01.

5) the main01 and main02 should have a explictly width and height property.
6) The scroll bar can not be visible anyway when the window resize.

In fact,I can make it using the javascript,but I wonder If I can make it using the pure css(of course the js is need to handle the click event)?

Since now I use the js,when the toggle_bar1 clicked,I set the left to “display:none”,then caculate the clientwidth,and set the width of the main01(or/and main02),I wonder if this can be caculated by the browser?

I always think that we should avoid do the extra position cacualte work if they can be done by the browser.

Any ideas?

  • 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-23T14:56:29+00:00Added an answer on May 23, 2026 at 2:56 pm

    You could add remove CSS Classes to the Main Wrapper.

    Let say you have the MainWrapper and in it “Left”, “Middle”, “Right”

    then you can add or remove CSS Classes from the MainWrapper

    .left-item, .right-item, .middle-item { // this are the classes in the Wrapper
    some base info
    }
    
    .has-left.has-middle .left-item {
    width:30%;
    } 
    .has-left.has-middle .middle-item {
    width:70%;
    }
    .has-left.has-middle .right-item {
    display:none;
    }
    

    What you would have to do with the other combinations, you should know.

    No you just use js to “add” or “remove” your css classes, and css does it for you.
    MainWrapper Classes: has-left, has-middle, has-right
    remove one of them, and your css adjusts.

    It sounds like you dont need any generic version, so this could do it…

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

Sidebar

Related Questions

I just want to make some HTML page with this layout . How could
I have html markup like this <button id=button1 onclick=alert='yup'></button> and I want to make
I've got this layout that i want to cut into html/css, but i'm struggling
I want to make a link from this page navigate to a details page
I want to make an HTML form with 2 select boxes. The selected option
So I want to make a HTML news letter to be sent out. I
I am traversing a HTML document using javascript DOM. I want make a list
I want to make some design tweaks. Here is the code for html: <div
Please, look at this example . I intend making horizontal layout with pure html/css,
I want to make a simple two column layout, where the right column is

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.