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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:36:57+00:00 2026-06-18T16:36:57+00:00

I am having Issue in using height . I have used height:100% for a

  • 0

I am having Issue in using height . I have used height:100% for a div in my page. And I set a background color for that. It works fine while the browser is maximised. But when it is resized my div is not rendered properly.

My problem is when I resize the browser window , a scroll appears for my div but the background color is not rendered for my whole div. It is rendered only for what portion I have seen when I resize the window.

My styleclass

html,body{height:100%;} 
.rightDiv{  height:100%;width: 39%;background: #3F5D91;float: right;color: #F0F0F0;}

Plz help me to get out of this problem.

Thanks in advance.

  • 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-18T16:36:58+00:00Added an answer on June 18, 2026 at 4:36 pm

    I’ve tested this using a local html file:

    <!DOCTYPE html>
    <html>
      <head>
        <style>
          html,body{height:100%;} 
          .rightDiv{height:100%;width: 39%;background: #3F5D91;float: right;color: #F0F0F0;}
        </style>
      </head>
      <body>
        <div class="rightDiv">Hello</div>
      </body>
    </html>
    

    and on Firefox 18.0.2/Windows7 I see the div on the right, coloured blue, and I see a scroll bar when full-screen, or resized.

    Scrolling reveals the rest of the div with the background colour intact, so I can’t account for why you see that.

    However, I’m wondering if you actually want to see the scroll bar. Setting an element to 100% usually means you just want it to fill the viewport, not spill over.
    If this is the case, then you need to remove any default margin that the browser applies to elements that contain your div, e.g. the body. Setting:

     html,body{margin:0; height:100%;}
    

    will make the div fit properly.

    Incidentally, sites like CodePen and JSFiddle offer the option of applying reset style sheets like Normalize and Reset, and you should watch out for these being pre-selected when you create a new pen/fiddle (JSFiddle does this for Normalize).

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

Sidebar

Related Questions

I'm having an issue where I have a min-height set up in a div
I'm having a fairly complicated layout issue that only occurs on Webkit browsers. Have
I'm having an issue with Fancybox 2.0 and Internet Explorer. It works fine on
I have got a div that needs to have a fixed height and will
I am having an issue I have yet to see elsewhere using the image
I'm having an issue appaently with the jQuery Declaration that I have in a
I am having a issue using Google's SDC (Secure Data Connector) with my Google
I'm having an issue using the Cookie class of the Servlet API 2.5 on
I'm having an issue using the qTip plugin with jQuery. I've created a js
I believe I am having a memory issue using numpy arrays. The following code

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.