CSS3:不(选择器)不工作的部分
问题描述:
我不太确定我做错了什么。
I'm not quite sure what I'm doing wrong.
section:not(#2) { font-size:33px; }
更新:
忘记了不使用数字的例子!
Forgot about not using numbers for the example!
愚蠢的我,我做了这样的事情,忘了#
之前当前
。 麻烦的语法错误。
Silly me, I was doing something like this and forgot the #
before current
. Pesky syntax errors.
current = $(this).attr('id');
$('section:not(#'+current+')').css('height',titleHeight);
答
您的 id
无效, id
从不以数字开头,您需要一个字母开头
Your id
is invalid, id
never starts with a number, you need an alphabet at the start
a href =http://jsfiddle.net/6EskH/3/ =nofollow noreferrer> 演示
Demo
<section id="a1">Section 1</section>
<section id="a2">Section 2</section>
<section id="a3">Section 3</section>
CSS
section:not(#a2) { font-size:33px; }
查看此答案了解更多详情