CSS3:不(选择器)不工作的部分 [英] CSS3 :not(selector) isn't working on section
本文介绍了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; }
查看此答案了解更多详情
这篇关于CSS3:不(选择器)不工作的部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文