Advertisement
Google Ad Slot: content-top
CSS Syntax
CSS syntax consists of a set of rules that are applied to HTML elements. Each rule has two main parts: selectors and declarations.
Syntax:
selector { Property: value; }
Components of CSS Syntax:
- Selector: Targets the HTML element(s) to be styled. Examples include elements (
h1,p), classes (.classname), and IDs (#idname). - Declaration Block: Contains one or more declarations inside curly braces
{}. Each declaration consists of:
- Property: The aspect of the element to be styled (e.g.,
color,font-size). - Value: The value applied to the property (e.g.,
blue,16px).