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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:50:19+00:00 2026-05-20T12:50:19+00:00

I have a problem with setting the height of the div: I have 3

  • 0

I have a problem with setting the height of the div:
I have 3 divs and svg element one in each other in such way:

<body>
  <div id="1">
    <div id="2">
      <div id="3">
        <svg></svg>
      </div>
    </div>
   </div>
</body>

(There are also other elements in div 1 and 2)

Assume that svg is very big (i.e. 2048×2048), I need that size of div3 (and this also would mean div2 and div1) to have size 100% of browser window (minus other elements and margins in uppers divs) – when a browser resize div also should. As the scg is bigger than div3 there should be a scrollbars in div3 (scrollbars should be in div3 not in whole browser window to scroll only content of div3 (the svg element) not of the whole browser content!).

I’ve already manage to make it works this way in width, but not in height,
when I set height of all elements except svg (also for body) to 100% as I found somewhere (also tried with min-height), then all divs are of height of svg and scrollbars apears on browser window, scrolling the whole page.

  • 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-20T12:50:19+00:00Added an answer on May 20, 2026 at 12:50 pm

    For any one interested in similiar case I managed to done this. I’ve resigined of using div3 (after all it wasnt needed) so the layout of page is smiliar to this:

    <div id="1">
     something          
     <div id="2">
      <svg width='2048' height='2048' ></svg>
     </div>
     <div id="footer">something</div>
    </div>
    

    and css is:

    body, html, {
    padding : 0px;
    margin : 0px;
    width : 100%;
    height : 100%;
    } 
    #nr2{
    overflow: scroll;
    position: absolute;
    top: 10px; /* must be the height of everything above div */
    left: 0px;
    right: 0px;
    bottom: 10px; /* must be the height of footer */
    }
    #footer{
    height: 10px;
    position: fixed;
    bottom: 0px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 divs nested within a parent div. Im having a problem setting
I have problem with setting proper charset on my jsf pages. I use MySql
I have a problem with setting the TTL on my Datagram packets. I am
I have a problem with setting Browsing Path in Delphi 2009: When I install
I have this weird problem with setting up cookies with PHP. Everything worked fine
i have problem to correctly bind data to WPF Chart. When i'm setting ItemsSource
I have a weird problem where after setting nocheck on a foreign constraint and
I have problems setting the focus on an input element that has been created
I have three divs with the following css: div#container { width: 780px; } div#photos
In IE8 I have a 100% width + height fixed position div, #photo-upload ,

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.