我是html和css的新手,如何让背景全尺寸?我假设它会在css中?
body {
background: url(../images/bg.jpg) no-repeat;
}
答案 0 :(得分:4)
试试这个:
body {
background: url(../images/bg.jpg) no-repeat;
-webkit-background-size: cover; /*-- Used for Chrome and Safari browsers --*/
-moz-background-size: cover; /*-- Used for Firefox browser --*/
-o-background-size: cover; /*-- Used for Opera browser --*/
background-size: cover; /*-- Used for IE browser --*/
}