我正在尝试为我正在构建的站点设置背景图像。我知道我必须使用 background: url();
但它似乎没有显示在 body
或特定的 div
中.
body {
/* background: linear-gradient(#2c3e50 75%, #ecf0f1 88%); */
background: url(c:\Users\Saleh\Desktop\Abid\ggbridge960.png);
} /* This is is what it looks like when I add it to body */
.container {
margin: 20px auto 20px auto;
/* border: 2px solid black; */
width: 960px;
height: 1000px;
/* background: url(c:\Users\Saleh\Desktop\Abid\ggbridge960.png) no-repeat; */
} /* this is what it looks like in the div. */
我已经分别尝试过它们,而不是同时。
最佳答案
像这样..
body {
background: url(file:///c:/Users/Saleh/Desktop/Abid/ggbridge960.png);
}
关于css - 我无法将背景图像设置为特定的 div 或 body,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20140374/