Link to home
Start Free TrialLog in
Avatar of mocaiv
mocaiv

asked on

asp.net absolute position with higher z-index to break free of parent div possible???

<div style="background-color:green; height:300px; width:300px; overflow:auto;">
    <div style="height:400px; width:400px; position:absolute; z-index:500; background-color:yellow; top:500px;">
    </div>
</div>

if you look at this in html, you'll see that the inner div positions it self lower but its still inside the overflow and now has scroll bars..  is there anyway possible to use css to break free of this and have the absolute positioning actually be the positioning on the page and not the div?
Avatar of Rejojohny
Rejojohny
Flag of United States of America image

try addin the second div tag outside the main div
<div style="height:400px; width:400px; position:absolute; z-index:500; background-color:yellow; top:500px;">
    </div>
<div style="background-color:green; height:300px; width:300px; overflow:auto;">
</div>

but you will have make changes to the position of the child div as per your requirement ..

Rejo
Dear simple set the Z-Index=9999 to the div to get it on working...
Avatar of mocaiv
mocaiv

ASKER

neither solution is valid.   placing the div outside of the main div is not a possible scenario.  .. setting the z-index to a ridiculous value like 9999 is also not a valid solution
ASKER CERTIFIED SOLUTION
Avatar of Qaiser_Mehmood_Mughal
Qaiser_Mehmood_Mughal
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>placing the div outside of the main div is not a possible scenario
can i ask why?
Avatar of mocaiv

ASKER

because thats the resulting code.  in the design of this  the div with the overflow: auto
contains a user control which contains a a div that contains information that needs to "hover" over everything , even over the parent container, outside the overflow boundaries