Question:

Which of the following is the syntax of CSS?

Show Hint

Always remember the order in CSS: Selector → Property → Value.
  • Select { property:value }
    
  • Selector { value:property }
    
  • Selector { property:value }
    
  • Select { value:property }
    
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understand the structure of a CSS rule.

CSS works by applying styling rules to HTML elements. Each CSS rule consists of two main parts:

Selector – identifies the HTML element to which the style will be applied.
Declaration block – contains the property and value that define the style.

Step 2: Explain the correct CSS syntax.

The general structure of CSS syntax is:

Selector { property : value ; }

Example:

h1 { color: red; font-size: 24px; } Here:

h1 is the selector.
color and font-size are properties.
red and 24px are values.

Step 3: Evaluate the other options.

Select { property:value } is incorrect because the correct keyword is Selector.

Selector { value:property } is incorrect because CSS always uses the format property:value.

Select { value:property } is incorrect because both the selector name and the order are wrong.

Step 4: Conclusion.

Therefore, the correct syntax of CSS is:

Selector { property : value ; }

Was this answer helpful?
0
0