CSS entry notes eight: background settings

1. Background image setting : background-image

2. Background color : background-color

3. Background tile : background-repeat

Note: There are 4 ways to tile the background, namely:

Copy and tile (repeat) : That is, the entire background is tiled, tile
along the x axis (repeat-x),
tile along the Y axis (repeat-y),
not tile (on-repeat) : the background is as big as it is

4 BACKGROUND positions : background-postion: xy; x , y pixel values may also be Nouns

Note:
If ax and y are azimuth nouns, there is no order distinction, that is, right center and center right are the same.
b. If there is only one position name, the other value is center alignment by default.
c. If x and y are exact values, then the first value must be x, and the second value must be y.
dx, y can also be mixed values, that is, the exact value and the position noun together, at this time the first value It must be x, and the second value must be y.

5. Background fixed : background-attachment; used to make a scrolling background. There are two attribute values, namely scroll (the background image is scrollable relative to the content) and fixed (the background image is fixed).

Compound writing of background :

background:颜色 地址 平铺方式 滚动方式 位置

6. Background transparency setting : background: rgbs(x,y,z,w). x, y, z are the values ​​of the three primary colors, w is the transparency, and the value is 0~1. When w is a decimal, 0 can be omitted .

Insert picture description here

Guess you like

Origin blog.csdn.net/m0_52021758/article/details/113060144