如何使用 CSS 和 HTML 设置可在 Chrome 中使用的背景图片?以下代码在 IE 中有效,但在 Chrome 中无效?
body
{
background-repeat: no-repeat;
background-color: transparent;
background-image: URL("\Backgrounds\bg.jpg");
}
最佳答案
这段代码有效!!
body {
background: url("../img/img_bg.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 100%;
}
关于html - 如何在 Chrome 中设置背景图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24568343/