CSS가있는 마우스 오버가있을 때 비활성화 된 버튼의 색상이 변경되지 않도록하려면 어떻게해야합니까?

user1943020

이 CSS를 시도했습니다.

html.dark .btn:hover:not(disabled),
html.dark .btn:focus {
  color: #ffffff;
  background-color: #222222;
  *background-color: #151515;
}
html.dark .btn.disabled,
html.dark .btn[disabled] {
  color: red;
  background-color: #222222;
  *background-color: #151515;
}

그러나 여전히 버튼 위로 마우스를 가져 가면 색상이 빨간색에서 흰색으로 변경되는 것을 볼 수 있습니다. 비활성화 된 사실을 올바르게 선택하고 있습니다. 나는 사용하고있다 :

disabled="disabled"

내 버튼에.

Akshay

시험 .btn:hover:not(:disabled),

작은 예

참조 의사 클래스.btn:hover:not(disabled) 가 필요한 것을 얻기 위해 의사 클래스를 사용해야 하므로 예제가 작동하지 않았습니다.

button:hover:not(:disabled){
    color:red;
}
<button>Not disabled</button>
<button disabled>disabled</button>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

Related 관련 기사

뜨겁다태그

보관