Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS3 :not(selector) isn't working on section

Tags:

css

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);
like image 305
Casey Dwayne Avatar asked Jan 24 '26 01:01

Casey Dwayne


1 Answers

Your id is invalid, id never starts with a number, you need an alphabet at the start

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

Take a look at this answer for more details

like image 67
Mr. Alien Avatar answered Jan 27 '26 00:01

Mr. Alien



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!