What are the relevant properties of the CSS background? The following article for you to bring about the CSS background properties of the introduction, there is a certain reference value, there is a need for friends to refer to, I hope you have some help.
1, CSS background properties for the content set background color: Background-color;
Property:
Color
Inherit; inherit a parent style
Box.html
<!doctype html>
Box.css
body{ background-color: #123456;}
2, CSS background properties for the content set background for the picture Background-image:url ();
Box.css
body{ background-color: #123456; Background-image:url (image.png); }
3, CSS Background properties of the fixed background image background-attachment
(using the Background-attachment property in CSS allows you to pin the picture to the browser, and if you drag the scroll bar, the background picture does not scroll as the page content scrolls, like text floating on the image)
Property value:
Scroll; background picture scrolls with content, default value
Fixed Background picture fixed, not scrolling with content
Inherit; inherit the parent class style
Box.css
body{ background-color: #123456; Background-image:url (image.png); background-attachment:fixed; font-size:45px; }
4, CSS background properties of the background image tile background-repeat;
Property value:
Repeat; tile background picture; default
No-repeat; a picture of uneven paving;
repeat-x; tile in horizontal direction
repert-y; tile in vertical direction
Box.css
body{ background-color: #123456; Background-image:url (image.png); background-attachment:fixed; font-size:45px; background-repeat:repeat-y; }
5. Background image of CSS background background-position
Property value:
Top;
Center;
bottom; bottom
right;
Left;
Inherit; inherit the parent class style
Style:
Xxxpx,xxxpx;
xxx%,xxx%;
Xxxpx,top;
Box.css
body{ background-color: #123456; Background-image:url (image.png); background-attachment:fixed; font-size:45px; Background-repeat:no-repeat; Background-position:left; }