Which is the correct CSS syntax?
-
body {color: black}
-
{body;color:black}
-
{body:color=black(body}
-
body:color=black
CSS syntax uses: selector { property: value; }. The selector (body) is followed by curly braces containing property-value pairs separated by colons. Option A shows this correctly. Option B reverses the order, Option C uses invalid syntax, and Option D uses a colon incorrectly.
body {color: black} is correct. Valid CSS syntax is: a selector (here body), followed by a declaration block in curly braces containing property:value pairs separated by semicolons (color: black). The other options misplace the braces and colons in ways that don't parse as CSS: putting the selector inside the braces ({body;color:black}, {body:color=black(body}) or using = instead of : and omitting braces entirely (body:color=black) — none of these follow the selector-then-braced-declarations grammar CSS actually requires.