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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:17:00+00:00 2026-06-05T07:17:00+00:00

<div class=container1></div> <div class=container2><div class=container2-inner></div></div> .container1 { height: 5000px; } .container2 { height: 100%;

  • 0
<div class="container1"></div>
<div class="container2"><div class="container2-inner"></div></div>

.container1 { height: 5000px; }
.container2 { height: 100%; width: 100%; position:absolute; }
.container2-inner { height: 1000px; margin: 0 auto; }

.container2-inner height varies depending on content inside (.container2 is overlay popup window).

Currently the vertical browser scroll is always 5000px no matter what OR more if .container2-inner exceeds 5000px. I’d like scroll to be only 1000px when popup window is active but I still want to keep 5000px high .container1 below. How do I achieve that?

  • 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-05T07:17:02+00:00Added an answer on June 5, 2026 at 7:17 am

    Not sure I understand your problem either based on your description but maybe something like…

    CSS

    HTML, BODY {padding:0;margin:0;}
    .container1 {height:5000px;background:red;}
    .container2 {height:100%;width:100%;position:absolute;top:0;left:0;background:green}
    .container2-inner {height:1000px;width:400px;overflow-x:hidden;overflow-y:scroll; margin:0 auto;background:yellow}
    

    HTML

    <div class="container1"></div>
    <div class="container2">
        <div class="container2-inner">
        Start Here<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        ...<br />...<br />...<br />...<br />...<br />...<br />
        End Here
        </div>
    </div>
    

    You can see the results at http://dabblet.com/gist/2876726

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

Sidebar

Related Questions

E.g: .container{ width:200px; height:16px;overflow:hidden;font-size:13px; } <div class=container> I want to know this sentence's width
I've got this html (simplified) <div class=outer style=float:left> <div class=inner style=float:left> <div class=contained style=clear:both>...</div>
<h2>Greetings</h2> <div class=container> <div class=inner> Hello <p>Test</p> </div> <textarea id=one class=inner> Goodbye </textarea> </div>
I want the container div to expand to the height of the div's inner
I have this Twitter Bootstrap code <div class='navbar navbar-fixed-top'> <div class='navbar-inner'> <div class='container'> <a
I have this markup: <div class='navbar'> <div class='navbar-inner'> <div class='container'> <a class='btn btn-navbar' data-target='.nav-collapse'
Why doesn't my bootstrap code scale down to mobile? <div class=navbar navbar-fixed-bottom> <div class=navbar-inner>
Say I have <div id= page> <div class = container> <a href=http://www.google.com></a> </div> </div>
I have div container and inside couple div with class demo and gravity like
I have div container and inside couple divs with class demo like <div id='container'

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.