Div position: absolute

Posted on 2009-02-24
Last Modified: 2012-05-06

I have posted my ASP.NET web pages simplified scheme. I would like to set position DIV #popup to absolute to the whole web page. Now it appears absolute to its parent containers. How to position popup div to absolute?

Please note that I can't take out popup div from containers due to nature of my web page, I just posted example.


HTML  {            height: 100%;        }

BODY {            text-align: center;     padding: 0px;   margin: 15px;  height: 100%;   }

#container   { position: relative;    width: 800px;     text-align: center;    margin: 10 auto 0;    }

#center    {position: relative;    left: 0px;    width: 100%;    }

#popup   { position: absolute; }

<div #container> 

  <div #center>

    <div #popup>




Open in new window

Question by:Tomazaz
    LVL 5

    Expert Comment

    #popup _will_ be absolute to the parents, you would need to set the parent's width and heights to 100% too.

    LVL 6

    Accepted Solution

    Try to add "top: 10px; left: 10px;" to the #popup, then it'll will take out the parents

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
    When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
    In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now