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“和"和“或"
基础教程推荐
- Bootstrap 模态出现在背景下 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
