CSS styles consist of selectors and declarations, and declarations are made up of attributes and values, as shown in:
Selectors, also called selectors, indicate the elements in the Web page to which you want to apply a style rule, as in this case, the text in all segments (p) in the page will turn blue, while other elements, such as OL, will not be affected.
Declaration: In English curly braces "{}" is the declaration, the attribute and the value are separated by the English colon ":". When there are more than one statement, the middle can be a semicolon ";" Delimited, as follows:
p{font-size:12px;color:red;}
Attention:
1, the last statement may not have a semicolon, but for later modification convenient, usually plus a semicolon.
2, in order to use the style easier to read, you can write each code in a new line, as follows:
p{ font-size:12px; color:red;}
Example:
<! DOCTYPE html>
CSS code syntax