다음이 작동하지 않는 이유를 이해하려고합니다. 내가 이해하는 한 form__group
요소가 .modal
아직 자식 이면 상자 그림자를주지 않아야합니다 .
div:not(.modal) .form__group:hover {
box-shadow: inset 10px 0 0 #ccc;
}
귀하의 HTML은 다음과 같습니다.
<div class="modal">
<div class="modal__body">
<div class="form__group">
Hover on me for the box shadow - it shouldn't be there
</div>
</div>
</div>
모달 div를 제거하면 다음을 얻습니다.
<div class="modal__body"> <!-- fits the "div:not(.modal)" -->
<div class="form__group">
Hover on me for the box shadow - it shouldn't be there
</div>
</div>
이후 .modal__body
되지 .modal
않습니다 그것은 당신의 문을 맞습니다.
해결책은 .modal__body
선택기 에 추가 하는 것입니다.
div:not(.modal) .modal__body .form__group:hover {
box-shadow: inset 10px 0 0 #ccc;
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다