CSS code syntax / CSS code comments

CSS code syntax

css style by the selectors and declarations composition, the statement and the attributes and values of the composition, as shown below:

Selector: also known selector elements specified page style rules to be applied, as in this case all pages of text segments (p) will turn blue, and the other elements (e.g., OL) will not be influences.

Statement: English English colon between the braces "{}" in the declaration is, attributes and values of ":". When multiple statements, the intermediate can semicolon ";" partition, as follows:

p{font-size:12px;color:red;}

note:

1, the last statement can not semicolon, but in order to facilitate future modifications, generally with a semicolon.

2, in order to use the style easier to read, each code can be written in a new line, as follows:

p{
   font-size:12px;
   color:red;
}

CSS commented code

As in Html comments, like, there are comments in CSS statement: use /*注释语句*/to designate (Html in use <!--注释语句-->). Like the code below:

 

Guess you like

Origin www.cnblogs.com/iBoundary/p/11422678.html