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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:29:52+00:00 2026-05-16T07:29:52+00:00

I want a div’s width and height to change with the browser as the

  • 0

I want a div’s width and height to change with the browser as the browser’s width and height are changed when a user changes their browses dimensions.

Code added based on the answers suggestion

<!doctype html>
<html>
    <head>
    <link rel="shortcut icon" href="/favicon.ico"> 
    <meta charset='UTF-8'>
    <%= stylesheet_link_tag 'application' %>
    <title>Some Company - Terms and Conditions</title>
</head>
<body >
<div>
    some anchor links here go to the content inside the div below
    </div>
   <div style="position: absolute; top: 100; bottom: 0; left: 0; right: 0;overflow:auto;padding:10px;border:1px solid lightblue;">
     content here
    </div>
</body>

Here was the end result:

<!DOCTYPE html>
<html>
<head><title>Terms and Conditions</title></head>
<body>
<a href="#tac20">Terms and Conditions 20</a> | <a href="#tac40">Terms and Conditions 40</a>

    <div style="position:absolute; top: 30px; bottom: 0; left: 0; right: 0;overflow-y:auto;padding:5px;border-top:1px solid lightblue;">
        Terms and Condition 1 <br/>     
        Terms and Condition 2 <br/>
        Terms and Condition 3 <br/>
        Terms and Condition 4 <br/>
        Terms and Condition 5 <br/>
        Terms and Condition 6 <br/>
        Terms and Condition 7 <br/>
        Terms and Condition 8 <br/>
        Terms and Condition 9 <br/>
        Terms and Condition 10 <br/>
        Terms and Condition 11 <br/>        
        Terms and Condition 12 <br/>
        Terms and Condition 13 <br/>
        Terms and Condition 14 <br/>
        Terms and Condition 15 <br/>
        Terms and Condition 16 <br/>
        Terms and Condition 17 <br/>
        Terms and Condition 18 <br/>
        Terms and Condition 19 <br/>
        <a name="tac20">Terms and Condition 20</name> <br/>
        Terms and Condition 21 <br/>        
        Terms and Condition 22 <br/>
        Terms and Condition 23 <br/>
        Terms and Condition 24 <br/>
        Terms and Condition 25 <br/>
        Terms and Condition 26 <br/>
        Terms and Condition 27 <br/>
        Terms and Condition 28 <br/>
        Terms and Condition 29 <br/>
        Terms and Condition 30 <br/>
        Terms and Condition 31 <br/>        
        Terms and Condition 32 <br/>
        Terms and Condition 33 <br/>
        Terms and Condition 34 <br/>
        Terms and Condition 35 <br/>
        Terms and Condition 36 <br/>
        Terms and Condition 37 <br/>
        Terms and Condition 38 <br/>
        Terms and Condition 39 <br/>
        <a name="tac40">Terms and Condition 40</name> <br/>
    </div>
</body>

  • 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-16T07:29:52+00:00Added an answer on May 16, 2026 at 7:29 am

    The right solution depends on the layout of the page. If you just have a single div you want to fill the browser window, I find this CSS the easiest solution:

    #theDiv { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.