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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:03:55+00:00 2026-06-16T08:03:55+00:00

<div class=con> <div class=left id=left> <input type=button value=set the height of the left panel

  • 0
<div class="con">
    <div class="left" id="left">
        <input type="button" value="set the height of the left panel" id="open" />
    </div>
    <div class="right" id="right"></div>
</div>

The left and right panel are both floated left,they work well when no scroll bar exist,however if the height of the left panel changed,and the scroll bar will display,then the right panel will go to bottom.

See exmaple here:

At first,the right div will display beside the left,when you click the button,the right will go to bottom.

How to fix it?


update

In fact I can not set the absolute size of the left and right div,since I want them resize according the content autoly.

Fullcode:

<!DOCTYPE HTML>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        html,body{
            padding:0px;
            margin:0px;
            height:100%;
        }
        .con{
            float:left;
            position:relative;
            left:100px;;
            top:100px;
            border:2px solid red;
            max-height:80%;
            overflow-y:auto;
        }
        .left{
            background-color:black;
            position:relative;
            float:left;

        }
        .right{
            background-color:blue;
            position:relative;
            float:left;
            width:300px;
            height:200px;
        }
    </style>
    <script type="text/javascript">
        window.onload=function(){
            document.getElementById("open").onclick=function(){
                document.getElementById("left").style.height="900px";
                //document.getElementById("right").style.width="300px";
                //document.getElementById("right").style.height="500px";
            }
        }
    </script>
</head>
<body>
    <div class="con">
        <div class="left" id="left">
            <input type="button" value="set the height of the left panel" id="open" />
        </div>
        <div class="right" id="right"></div>
    </div>
</body>
</html>
  • 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-16T08:03:57+00:00Added an answer on June 16, 2026 at 8:03 am

    This works…

    .con{
        float:left;
        position:relative;
        left:100px;;
        top:100px;
        border:2px solid red;
        max-height:80%;
        overflow-y:scroll;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form: <div class=class_a> <fieldset> <label><input type=radio id=radio10 name=color value=1 />Red</label><br
My div with class name 'header-body-right' doesn't seem to be floating to the left
I have this HTML: <div id=studyTestContent class=studyTestItem> <input type=text class=dropInput size=15> <ul class=inputDrop style=display:none;>
<div class = 'buttons'> <button type=submit class=regular name=save> <img src=elephant.png alt=/> Memory </button> </div>
I am trying to hide the div class hideme based on value of full_day
So lets say i have the following html: <div class=con> <ul> <li class=a>1</li> <li
'<div class=lightbox-con> <div class=lightbox-shade></div> <span class=logo></span> <div class=controls> <span class=arrow back></span><span class=close></span><span class=arrow forward></span>
I want to locate a div and replace both the content and div class
I have a div class set up with the following CSS style: div.multiple_choice{ border:
I'm trying to assign 10 div class hi with different height. I know 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.