Cascading Style Sheets (CSS) Syntax

CSS – Syntax

CSS style syntax is divided into three parts:
the selector, the property, and the value, with braces around the property. Also, the property is separated from the value by a colon

selector {property: value};
CSS Syntax Examples


Examples 1
Define a HTML paragraph with its colour as as Red
p {colour: red};

Define h1 type fount to be bold
h1 {font-weight: bold;}

Define CSS style for a group

If you want to apply CSS style to a bunch of elements with same styling option, group definition can be given in that case.
If you want to define all HTML heading elements i.e. h1, h2, h3, h4 to Century Font do as below
h1,h2,h3,h4 {font-family: Century;}