![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Hi all, I've met a problem with Opera and its ability to render absolutely positioned divs inside relatively positioned parent blocks, themselves contained inside a relatively positioned block. I'm surely missing something, but what? Any help would be kindly appreciated ![]() Here's a code sample: |
|
The display:none property is modified to display:block on a click event happening somewhere else. Hence the hidden div appears as a submenu, whose position depends on the parent block. |
|
Any clue on why Opera cannot position this child block correctly? |
|
Or is there anything wrong with my way of doing it? In fact, the .sub divs seem to be positioned relative to the .grandparent div, not their respective .parent divs. |
#3
| |||
| |||
|
|
.grandparent{position:relative;} .parent{position:relative;} .parent .sub{ position:absolute; top:19px; left:0px; display:none; z-index:1; } div class="grandparent" div class="parent" div class="sub">text</div /div /div Any clue on why Opera cannot position this child block correctly? Or is there anything wrong with my way of doing it? In fact, the .sub divs seem to be positioned relative to the .grandparent div, not their respective .parent divs. |
#4
| |||
| |||
|
|
I've met a problem with Opera and its ability to render absolutely positioned divs inside relatively positioned parent blocks, themselves contained inside a relatively positioned block. .grandparent{position:relative;} .parent{position:relative;} .parent .sub{ position:absolute; top:19px; left:0px; display:none; z-index:1; } div class="grandparent" div class="parent" div class="sub">text</div /div /div The display:none property is modified to display:block on a click event happening somewhere else. Hence the hidden div appears as a submenu, whose position depends on the parent block. |
|
Any clue on why Opera cannot position this child block correctly? Or is there anything wrong with my way of doing it? In fact, the .sub divs seem to be positioned relative to the .grandparent div, not their respective .parent divs. |
#5
| |||
| |||
|
|
Do you by any chance have a float on .parent? That will make a difference. Opera doesn't allow an element to be both positioned and floated and will apply the float but ignore the position. |
![]() |
| Thread Tools | |
| Display Modes | |
| |