Free guides, interview Q&As, and job responsibility breakdowns — curated by industry veterans to help you crack MNC interviews
CSS follows a rule-based structure. Each rule consists of a selector and a declaration block. Each CSS rule comprises a selector and a declaration block, where selectors identify the HTML elements to style, and declaration blocks define the properties and their corresponding values.

Key Elements of CSS Syntax
Example: Single Property Declaration


Within the declaration block, there can be multiple pairs of properties and values.
Example: Multiple Property Declarations

Here, button is the selector, and there are multiple pairs of properties and values. Each pair is separated by a semicolon ;.