Advertisements
Advertisements
Question
Which is the correct CSS syntax?
Options
{p:color=black(p}p {color: black;}{p;color:black}p:color=black
MCQ
Advertisements
Solution
p {color: black;}
Explanation:
A proper CSS rule is split into distinct anatomical parts:
- Selector (p): Targets the specific HTML element to style.
- Declaration Block ({ ... }): Encloses all style rules for that selector.
- Property (color): Specifies the visual trait you want to alter.
- Separator (:): Placed between the property and its value.
- Value (black): Defines the settings applied to the property.
- Terminator (;): Closes out that specific line of code.
shaalaa.com
Is there an error in this question or solution?
