【问题标题】:How in SASS i can select an input type checkbox, checked and disabled?如何在 SASS 中选择输入类型复选框,选中并禁用?
【发布时间】:2020-01-30 14:27:03
【问题描述】:

如何在 SASS 中选择 <input type=checkbox disabled checked> 并设置其样式?

我试过了,但没有放任何样式:

  input {
    &:checked &:disabled{
      background-color:red;
    }
  }

【问题讨论】:

  • 你应该写&:checked:disabled。但是复选框不响应background-color

标签: html sass


【解决方案1】:

这是您可以尝试的代码。

input {
    &:checked:disabled{
      background-color:red;
    }
}

但是样式不适用于复选框。由于复选框还不能原生设置样式。参考css - Why Cannot Change Checkbox Color Whatever I Do?

【讨论】:

  • 完美这个作品。我用它来设计带有&:checked:disabled + label 的兄弟标签。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-01-09
  • 2018-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多