我正在尝试选择除了和之外input的所有元素.typeradiocheckbox
很多人已经表明你可以放入多个参数:not,但是使用type似乎无论如何都没有用到我试试.
form input:not([type="radio"], [type="checkbox"]) {
/* css here */
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我有这个布局:
<div id="sectors">
<h1>Sectors</h1>
<div id="s7-1103" class="alpha"></div>
<div id="s8-1104" class="alpha"></div>
<div id="s1-7605" class="beta"></div>
<div id="s0-7479"></div>
<div id="s2-6528" class="gamma"></div>
<div id="s0-4444"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
使用这些CSS规则:
#sectors {
width: 584px;
background-color: #ffd;
margin: 1.5em;
border: 4px dashed #000;
padding: 16px;
overflow: auto;
}
#sectors > h1 {
font-size: 2em;
font-weight: bold;
text-align: center;
}
#sectors > div {
float: left;
position: relative;
width: 180px;
height: 240px;
margin: 16px 0 0 16px;
border-style: solid;
border-width: 2px;
}
#sectors > div::after {
display: block;
position: absolute; …Run Code Online (Sandbox Code Playgroud) 我使用选择器来选择没有一个类的所有元素:
.list th:not(.foo) {
/* some rules */
}
Run Code Online (Sandbox Code Playgroud)
如何将其应用于多个课程?
.list th:not(.foo), .list th:not(.bar) {
/* some rules */
}
Run Code Online (Sandbox Code Playgroud)
上面的CSS当然不会这样做,我需要像这样的伪:
.list th:not(.foo and .bar)
Run Code Online (Sandbox Code Playgroud)
CSS中有可能吗?