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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:24:27+00:00 2026-06-09T10:24:27+00:00

I have <div id=overlay> <div></div> </div> the height and width of the outer div

  • 0

I have

<div id=overlay>
    <div></div>
</div>

the height and width of the outer div is set to 100%.

What happens here is, the 100% refers to the size of the element inside (inside div).

I have a dynamically changing element on inside div, and I wanted to be my outer div got the size of the page screen.

NOTE that these div (outer and inside) are a popup element. So I wanted to cover all other elements behind the popup that’s why I need the 100% of the page behind.

this is my css for the outer div

#overlay {
 visibility: hidden;
 position: absolute;
 left: 0px;
 top: 0px;
 width:100%;
 height:100%; 
 min-height: 100%;
 min-width: 100%;      
 height: auto !important;
 width: auto !important;       
 text-align:center;
 z-index: 1000; 
 background-image:url(template/popup-bg.png); 
} 

my js

function overlay(e) 
{
el = document.getElementById("overlay");
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}
  • 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-09T10:24:28+00:00Added an answer on June 9, 2026 at 10:24 am

    Simply change the HTML to this

    <div id='overlay' class='hideOverlay'>
        <div></div>
    </div>
    

    Now on clicking simply change the class.
    Change your js to this

    function overlay(e) 
    {
        $('#overlay').attr('class', 'showOverlay');
    }
    

    Check the following style

    .showOverlay
    {
        background-color: red;
        height: 100%;
        left: 0;
        top: 0;
        opacity: 0.2;
        position: fixed;        
        width: 100%;
        z-index: 1001;
    }
    
    .hideOverlay
    {
        display:none;
    }
    

    Background-color is given just to check the div’s visibility. Change it as per your choice.
    It is nice to have some opacity for overlays to have a better look and feel effect.

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

Sidebar

Related Questions

It seems that in Firefox, if I have div A with fixed width/height and
I have overlay inside HTML element and inside that overlay I have element that
I have a min-height 100% div that contains all the content of my website:
I have two divs one inside another, i would like to overlap one div
I have DIV element which only has a few lines in and a background
I have div ( #child ) which won't expand to the full height of
So currently I have: #div { position: relative; height: 510px; overflow-y: scroll; } However
I have this: function startLoad(object_id) { $j('div#'+object_id).addClass('currently-loading'); var con = $j('div#overlay'); var img =
I'd like to overlay a div (or any element that'll work) over a table
I have a jquery Overlay over a div. It works pretty well, except, when

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.