html - z-index of elements in different parents in Chrome -


there 2 containers. 1 fixed , covers 100% of screen. second relative - contains scrollable content. problem there 4 elements positioned relative each other follows: 1st in fixed container, 2nd in absolute, 3rd fixed, 4th in absolute.

<div class="container fixed">     <div class="el z1"></div>     <div class="el z3"></div> </div> <div class="container relative">     <div class="el z2"></div>     <div class="el z4"></div> </div> 

however, z-index of 1 of parents less other, not allow order 4 children elements.

there fiddle http://jsfiddle.net/only_dimon/zky4c/6/ want order: yellow, green, white, black bottom. can see - yellow, white, green, black.

the result want:
enter image description here

but elements should in different containers.

thanks in advance!

this helps me: many elements helps html reconstruction. luckily don't need use fixed container fixed elements, because fixed element's position , sizes depends on window size, if put them relative container.

after further investigation, child element can't/aren't suppose able overrule parent z-index, browser example firefox though ignores parent index reason , displays elements wish every other browser i've tried (opera,safari,chrome) not, no it's not possible accomplish want without changing mark-up of html cross-browser compatibility.

edit:

you can find quite posts in subject.

how can child of element lower z-index on front of child of element higher z-index?

how parent element appear above child

can override z-index inheritance parent element?

edit - 2:

depending on want accomplish there many alternative way fake "zindex" behaviour, 1 thing worth looking @ pointer-events:none; transparent background you'd never know it's above other element.

if it's background, use box-shadows diffrent settings fake it.

can't come other reason atm if tell me i'll try give solution aswell.

regards


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -