A CSS rule consists of a selector and a declaration block.
The selector indicates the HTML element to be styled.
One or more declarations are separated by semicolons in the declaration block.
Each declaration has a colon-separated list of CSS property names and values.
Semicolons are used to separate several CSS declarations, while curly braces are used to enclose declaration blocks.
CSS EXAMPLE
HTML
<!DOCTYPE html>
<html>
<body>
<p>Hello World!</p>
<p>These paragraphs are styled with CSS.</p>
</body>
</html>
CSS
p {
color: red;
text-align: center;
}
Explanation of an Example
In CSS, p is a selector (it points to the HTML element you wish to style: p>).
Color is a property, and red is the value of that property.
text-align is a property, and the property value is center.