Search code examples
htmlcssstandardsw3c

CSS-Selector single rule


Does anybody know whether the semicolon is required in a CSS -selector if there is only one command? I couldn't find in the w3c standrd.

body{color:red}

Or

body{color:red;}

Solution

  • No, it is not required when you only have one style defined but if you have multiple ones defined it is required on all but the last one.