3

I'm not quite sure what I'm doing wrong.

Here's the Fiddle

section:not(#2) { font-size:33px; }

Update:

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

2 に答える 2

6

あなたidは無効idです。数字で始まることはありません。先頭にアルファベットが必要です

デモ

<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; }

詳細については、この回答をご覧ください

于 2013-05-11T19:12:51.873 に答える