Programming

Sass Nesting for : hover가 작동하지 않음

procodes 2020. 3. 3. 23:09
반응형

Sass Nesting for : hover가 작동하지 않음


이 질문에는 이미 답변이 있습니다.

이 코드를 작성했지만 작동하지 않습니다. 내 문제는 무엇입니까?

.class {
    margin:20px;
    :hover {
        color:yellow;
    }
 }

중첩시 선택기를 함께 연결하려면 부모 선택기 ( &) 를 사용해야합니다 .

.class {
    margin:20px;
    &:hover {
        color:yellow;
    }
}

생성 된 CSS를 통과 할 때 이러한 것들을 쉽게 디버깅 할 수 있습니다. 이 경우 변환 후 의사 선택기가 클래스에 연결되어야합니다. 그렇지 않습니다. 사용하다 "&".

http://sass-lang.com/documentation/file.SASS_REFERENCE.html#parent-selector

.class {
    margin:20px;
    &:hover {
        color:yellow;
    }
}

참고 URL : https://stackoverflow.com/questions/15983639/sass-nesting-for-hover-does-not-work



반응형