English

Which is the correct CSS syntax?

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?
Chapter 6: Cascading Style Sheets (CSS) - Assisted Practice [Page 271]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 6 Cascading Style Sheets (CSS)
Assisted Practice | Q 9. | Page 271
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×