CSS Syntax (original) (raw)
Last Updated : 11 May, 2026
CSS syntax defines how CSS rules are written so that browsers can interpret and apply them to HTML elements. It is useful for styling and designing web pages efficiently.
- It defines how styles are applied to HTML elements.
- It uses selectors to target elements.
- It consists of properties and values inside a declaration block.

- **Selector: Targets the HTML element "h1" to apply styles.
- **Declaration Block: Enclosed in curly braces { }, contains one or more declarations.
- **Property: Specifies the style attribute, here "color" for text color.
- **Value: Defines the property's setting, here "blue" for the text hue.
- **Overall Structure: Forms a complete CSS rule: h1 { color: blue; }, styling h1 headings blue. HTML `