相关疑难解决方法(0)

可以:not()伪类有多个参数吗?

我正在尝试选择除了和之外input的所有元素.typeradiocheckbox

很多人已经表明你可以放入多个参数:not,但是使用type似乎无论如何都没有用到我试试.

form input:not([type="radio"], [type="checkbox"]) {
  /* css here */
}
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

css css-selectors css3

726
推荐指数
5
解决办法
28万
查看次数

为什么我的jQuery:not()选择器不在CSS中工作?

我有这个布局:

<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)

css jquery css-selectors css3 jquery-selectors

57
推荐指数
1
解决办法
1万
查看次数

没有类的CSS选择器

我使用选择器来选择没有一个类的所有元素:

.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中有可能吗?

css css3

5
推荐指数
1
解决办法
125
查看次数

标签 统计

css ×3

css3 ×3

css-selectors ×2

jquery ×1

jquery-selectors ×1