Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a semicolon outside of curly braces do?

Tags:

css

This has had me tearing my hair out for an hour:

div {
  key: value;
  ...
};

img {
  key: value;
  ...
}

(Note the semicolon after the curly brace). None of the styling for imgs was showing up ... finally I noticed the semicolon and removed it -- voila! it all works as expected.

The question: what does a ; outside of curly braces mean?

like image 978
Matt Fenwick Avatar asked Dec 13 '22 06:12

Matt Fenwick


1 Answers

what does a ; outside of curly braces mean?

Invalid syntax.

That's why the parser stopped there and didn't pick up any of the style rules below (e.g. img). Validate it yourself.

like image 71
Jason McCreary Avatar answered Dec 28 '22 00:12

Jason McCreary