인프런 커뮤니티 질문&답변
relative 선언만으로 before의 bgc에 가려져있던 아이콘이 보이는 부분이 이해가 안갑니다.
작성
·
406
답변 1
1
코딩웍스(Coding Works)
지식공유자
z-index가 같다는 기준에서 position: absolute 보다 position: relative가 우선합니다.
a태그의 자식요소인 :before와 .fa 2개가 있습니다.
:before에 position: absolute가 있어서 .fa보다 우선합니다.
그러나 .fa에 position: relative를 주면 :before보다 우선합니다. 그러서 .fa가 :before 위로 올라옵니다.
z-index가 같다는 기준에서 position: absolute 보다 position: relative가 우선합니다... 이거는 규칙이니까 그렇게 됩니다.





