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><HTML><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8"><title>CSS code syntax</title><styletype= "Text/css">P{font-size:12px;Color:Red;Font-weight:Bold;}</style></Head><Body><P>XX network, ultra-cool Internet, it technology free learning platform, innovative network one-stop learning, practical experience, timely and thoughtful service, content professional, fun and easy to learn. Focus on the service of Internet engineers quickly become a master of technology!</P></Body></HTML>
CSS code syntax