微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

css选择器 – CSS“和”和“或”

我有很大的麻烦,因为我需要通过样式化一些输入类型的anathematise。我有类似的东西:
.registration_form_right input:not([type="radio")
{
 //Nah.
}

但我不想也样式复选框。

我试过了:

.registration_form_right input:not([type="radio" && type="checkBox"])
.registration_form_right input:not([type="radio" && "checkBox"])
.registration_form_right input:not([type="radio") && .registration_form_right input:not(type="checkBox"])

如何使用&&amp ;?我需要使用||很快,我认为用法会一样。

更新:
我还是不知道如何使用||和&&正确。我在W3文档中找不到任何东西。

解决方法

&&&通过将多个选择器连接在一起来工作,如:
<div class="class1 class2"></div>

div.class1.class2
{
  /* foo */
}

一个例子:

<input type="radio" class="class1" />

input[type="radio"].class1
{
  /* foo */
}

“||”通过用逗号分隔多个选择器来工作 – 因此:

<div class="class1"></div>
<div class="class2"></div>

div.class1,div.class2
{
  /* foo */
}

作为旁注,我建议不要使用“不”选择器,因为它不支持Internet Explorer。根据一项调查,60%的人使用某种版本的Internet Explorer,因此您的网站不会为很多人工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。