React Checkbox не мог иметь активное состояние при нажатии на метку, кроме ⇐ CSS

Разбираемся в CSS
Гость
React Checkbox не мог иметь активное состояние при нажатии на метку, кроме

Сообщение Гость »


Флажок не мог находиться в активном состоянии при нажатии на метку справа

Код: Выделить всё

const [checkTandC, setCheckTandC] = useState(false)


 setCheckTandC(!checkTandC)} />
Are you agree to Clicon Terms of Condition and Privacy Policy.


styles.css

Код: Выделить всё

.account-wrapper-form .form-check-input:checked{
background-color: #FA8232;
border-color: #FA8232;
}
.account-wrapper-form .form-check-input:checked[type=checkbox]{
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
/* font-size: 20px; */
}
.form-check-input:active{
filter: brightness(90%);
}
I would like to have the checkbox be in active state while clicking the label on the right side but it only works when clicking on the checkbox. May I ask how to have the checkbox have the brightness changed when clicking on checkbox and also clicking the label?


Источник: https://stackoverflow.com/questions/781 ... el-besides

Вернуться в «CSS»