CSS quot;andquot; and quot;orquot;(CSS“和和“或)
问题描述
我遇到了很大的麻烦,因为我需要对某些输入类型进行样式化处理.我有类似的东西:
I've got quite big trouble, because i need to anathematise from styling some input types. I had something like:
.registration_form_right input:not([type="radio")
{
//Nah.
}
但我也不想为复选框设置样式.
But i don't want to style checkboxes too.
我试过了:
.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"])
如何使用&&
?而且我很快就需要使用 ||
,而且我认为用法会一样.
How to use &&
? And I'll need to use ||
soon, and I think that usage will be same.
更新:
我仍然不知道如何正确使用 ||
和 &&
.我在 W3 文档中找不到任何内容.
Update:
I still don't know how to use ||
and &&
correctly. I couldn't find anything in W3 docs.
推荐答案
&&
像这样将多个选择器串在一起工作:
&&
works by stringing-together multiple selectors like-so:
<div class="class1 class2"></div>
div.class1.class2
{
/* foo */
}
另一个例子:
<input type="radio" class="class1" />
input[type="radio"].class1
{
/* foo */
}
||
通过使用逗号分隔多个选择器来工作:
||
works by separating multiple selectors with commas like-so:
<div class="class1"></div>
<div class="class2"></div>
div.class1,
div.class2
{
/* foo */
}
这篇关于CSS“和"和“或"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:CSS“和"和“或"


- 失败的 Canvas 360 jquery 插件 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01