CSS Syntax
CSS syntax is based on selector and declaration.Selector is basically HTML element while as declaration consists of CSS property and value separated by colon(:) and each declaration end with semicolon(;),and the declaration groups are surrounded by curly braces {}.
Step To Write CSS Syntax
- Step1- Select HTML selector i.e HTML element. Let us select paragraph element(p)
- Step2-Apply CSS declaration rule on the HTML selector. Declaration rule is basically CSS property and value that is separated with a colon(:) and each declaration ended with a semicolon and all the declaration statement exists within curly braces{} i.e
p{color:red;font-size:20px;}
Example
h1{ color: blue; text-align: center; }