This article brings the content is about CSS in the background (background) attribute introduction, there is a certain reference value, the need for friends can refer to, I hope to help you.
Shorthand Order: Color-image-repeat-attachment-position
Eg:body{background: #ffffff url (' img.png ') No-repeat right Top}
Come down and introduce each attribute feature in order:
Background-color:red, #ffffff; RGB (255,255,255);
Three colors are represented by color name, hexadecimal and RGB, background color can be set for all elements, and transparent by default.
Ii. background-image:url (' img.jpg ')
The image address can be a relative path or an absolute path; The default tile is repeated;
Third, background-repeat:repeat-x;repeat-y;no-repeat;
Default tile repeat display;
Iv. Background-attachment:scroll;fixed;local;inherit;
Background-attachment means whether the background image is fixed or scrolled along with the rest of the page; default scroll;
Scroll refers to the background image that scrolls with the rest of the page, fixed to the invariant, inherit from the parent element, and local scrolling with the scrolling element.
Five, Background-position:bottom center;top;66% 33%;50px 100px;
4 Representations: One is the top,left,bottom,right,center combination; the second is a value, the system defaults to center, the third is the percentage, and the four is the direct write pixel.
The latter two are of high accuracy.
VI. Background-clip:border-box;padding-box;content-box; Specifies the drawing area of the background map.
Seven, Background-origin:border-box;padding-box;content-box; Specifies the location area of the background map.
Note: If the background image background-attachment is "fixed," this property has no effect.
Eight, Background-size:auto (default); Length (two values, one width one high, one value if the default second is auto);p ercentage (The principle of assignment is the same length); Cover (This will maintain the image's aspect ratio and scale the image to a minimum size that will completely cover the background positioning area); contain (at which point the aspect ratio of the image is maintained and the image is scaled to fit the minimum size of the background positioning area);