1. Construct style sheet: selector{
Property:value;
Property:value;
}
Selector is the element that needs to change the style, property is the name of the CSS attribute, which format value is applied
2./* Comment */
3. When the rules conflict, the server preferred to select the specific strong; Important's
4. The value of the CSS property can be divided into: inherited value (input inherit at value), predefined value (left,right,none), length or percentage, pure number, color
5. CSS color is divided into: RGB (Color:rgb (red, green, blue)) (all in 0~255 numbers); hexadecimal number (color: #红色绿色蓝色) (blue can be converted to 16 binary); RGBA (red, green, blue, transparency) (transparency with 0~ A decimal representation between 1, where 1 is completely opaque), HSL (hue, saturation, brightness) (the number of hues between 0~360, and the remaining two percentages); HSLA (hue, saturation, brightness, transparency)
6. Create an external style sheet by putting the corresponding rules into the formulation text and saving them at the end of the. css
7. Link external style sheet: Enter <link rel= "stylesheet" href= "Url.css" in head section/> (there is a space between the Rel attribute and the href, with a space at the end)
8. Create an embedded style sheet: Enter <style></style> in the Head section (add any number of style rules in the middle)
9. Apply inline style: Enter Style= "" (in the middle you can add any number of style rules, separated by semicolons) in the label where you want the formatting element to begin.
10. Style stacking and ordering rules: under other conditions, the later style precedence is higher (inline styles override other styles that conflict with them)
11. Media-related style sheet: 1) Enter Media= "Print/screen/all" in the link or style start tag;
2) Direct input @media print/screen/all{} (middle add style, separated by semicolons)
12. Construct selector:
1) Depending on the type or name of the element.
Format: Name of the element to select (example: h1) {attribute name; applied format;} (example color;red)
2) Depending on the context in which the element resides.
Format: Context (example H1) the name of the element to select (example EM) {The name of the property; the applied format;}
A) Enter ancestor (the ancestor of the element to be formatted) in the style sheet (you can continue to enter ancestor as appropriate) descendant (the element to be formatted) {The name of the property; the applied format;}
b) in the style sheet, enter the parent (the selector that contains the element to be formatted) > (you can continue to enter parent as appropriate) child (the element to be formatted) {The name of the property; the applied format;}
c) Enter sibling (the element in the same parent element that appears directly before the target element) in the style sheet + (you can continue to enter sibling as appropriate) element (the elements to be formatted) {The name of the property; the applied format;}
3) Depending on the class or ID of the element
4) Depending on the pseudo-class or pseudo-element of the element.
5) Depending on whether the element has certain attributes and values
13. Select the first or last child element:
Enter the first or last child element that you want to apply the style to (optional step); Select the first/last child element input: The name of the First-child/last-child{property; the applied format;}
14. Select the first letter or the first line of an element:
Enter element (selector to format Element): First-letter (first letter) {attribute name; applied format;}
Enter element (the selector to format the element): First-line (first row) {property name; applied format;}
Code Summary about CSS3 (partial)