절대 값을 가진 요소와 함께 Z- 인덱스 속성이 작동하지 않는 이유는이 요소에 위치가 고정 된 부모가있는 이유는 무엇입니까? 나는이 사건에 대한 간단한 example하게고정 부모가있는 절대 위치 요소에 대한 Z- 인덱스
HTML :
<div id='q1'>
<div id='q2'></div>
</div>
CSS : Z- 인덱스가 동일한 스택의 요소를 기준으로하기 때문에
#q1 {
position: fixed;
width: 100%;
height: 50px;
background-color: red;
z-index: 0;
}
#q2 {
position: absolute;
top: 80%;
border: 2px solid black;
width: 100px;
height: 30px;
background-color: green;
z-index: -1;
}