(编辑:jimmy 日期: 2024/12/30 浏览:2)
body {background-color: black;}
h1 {background-color: #00ff00;}
h2 {background-color: transparent;}
p {background-color: rgb(0,0,255);}
body {background-image:url(../images/background.jpg);}
或
<body style="background-image:url(../images/background.jpg);">
body {
background-image:url(../images/background.jpg);
background-repeat:repeat-y; /*垂直重复*/
}
p {
background-image:url(../images/background.jpg);
background-position:20px -30px;
background-repeat:no-repeat;
}
div {
background-image:url(../images/background.jpg);
background-position:50% 20%;
background-repeat:no-repeat;
}
.para6 {
background-image:url(../images/background.jpg);
background-position:50% 20% ;
background-repeat:no-repeat;
background-attachment:fixed;
}
background:background-color background-image background-repeat background-attachment background-position;
.para7 {
background:#000000 url(../images/background.jpg);
}
.para8 {
background:url(../images/background.jpg) repeat fixed left top;
}