CSS Syntax
- Previous Page CSS Introduction
- Next Page CSS Selector
CSS Syntax
The CSS rule-set (rule-set) is composed of selectors and declaration blocks:

The selector points to the HTML element you need to style.
A declaration block contains one or more declarations separated by semicolons.
Each declaration contains a CSS property name and a value, separated by a colon.
Multiple CSS declarations are separated by semicolons, and declaration blocks are enclosed in curly braces.
Example
In this example, all <p> elements will be centered and have red text color:
p { color: red; text-align: center; }
Example Explanation
p
Is in CSSSelector(It points to the HTML element to be styled: <p>).color
Is a propertyred
Is a property valuetext-align
Is a propertycenter
Is a property value
In the next chapter, you will learn more about CSS selectors and CSS properties.
- Previous Page CSS Introduction
- Next Page CSS Selector