Declarations

A CSS declaration always ends with a semicolon, and declaration groups are surrounded by curly braces:

p {color:red;text-align:center;}

To make the CSS code more readable, you can put one declaration on each line. In the following example all <p> elements will be center-aligned, with a red text color:

p {
    color: red;
    text-align: center;
}
Back button Table of Contents Next button