Thoroughly learn CSS-2 in one article

Thoroughly learn CSS-2 in one article

1. Background-related attributes (background)

1. Background color

Insert picture description here

2. Background image

Insert picture description here

3. Background tile

Insert picture description here

4. Background position

Insert picture description here

5. Continuous writing of background

Insert picture description here

Two, the three display methods of the label (important, will definitely!!)

Insert picture description here

1. Block-level elements

Insert picture description here

2. Elements in the line

Insert picture description here

3. Inline block elements

Insert picture description here

4. Conversion of three display modes

Insert picture description here

3. Line-height

Insert picture description here

Four, pseudo-class selector (understand)

A state of the selected element, and just find the element and disappear

1. Introduction to pseudo-class selector

Insert picture description here

2. Points to note about pseudo-class selectors

Insert picture description here

Five, a small summary of the centering method

1. Make the content of the label (text, picture, span) horizontally centered

Insert picture description here

2. Let the content of the label (text, image, span) be vertically centered

Insert picture description here

3. Make the box center itself horizontally

Insert picture description here

4. Make the box center itself vertically

Insert picture description here

Six, box model

A way of thinking (everything is a box, every label can be seen as a box)
Insert picture description here

1. The composition of the box model

Insert picture description here

2. Border (border-border-outer paper shell of the box)

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here

3. Inner margin (padding-inner margin-bubble of the box)

Insert picture description here

4. Calculate the size of the box

Insert picture description here
Insert picture description here

5. Margin (margin-outer margin-the distance between the box and the box)

Insert picture description here
Insert picture description here

6. Clear the default inner and outer margins

Insert picture description here

7. Line-height (Supplementary Note)

Insert picture description here

1. The unit of row height

Insert picture description here

2. Concatenation of line height and font

Insert picture description here

8. Two special phenomena of margin (understand)

1. Marign's merger phenomenon

Insert picture description here

2. The collapse of margin (required for interviews and exams!)

Insert picture description here

Nine, floating

1. Floating first experience

Insert picture description here

2. Floating characteristics (understand)

Insert picture description here

3. Floating case

Insert picture description here
Insert picture description here

4. Clear float (clear the impact of float)

Insert picture description here

Additional labeling

Insert picture description here

Use overflow to clear floats

Insert picture description here

Use pseudo elements to clear floats

Insert picture description here

Set height

Insert picture description here

5. The meaning of floating

Insert picture description here

10. Expand

1. Regarding the use of padding and margin in the industry

Insert picture description here

Guess you like

Origin blog.csdn.net/xiaotai1234/article/details/108526690