Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想设置页面背景图片我的 CSS 代码是 -
background:url(images/body_bg.jpg) repeat-x top;
但是图像大小没有网页那么大,只有一条细条和渐变颜色。所以我怎样才能重复图像以使其占据整个背景?正如我所说的那样,它是渐变的,所以我不能硬核背景颜色。
在此处查看演示。
background:url(images/body_bg.jpg) repeat left top;
更多信息:
http://www.w3schools.com/css/css_background.asp
您可以使用它background: #000000 url(images/body_bg.jpg) repeat-x top; 并替换#000000为结束渐变的颜色。
background: #000000 url(images/body_bg.jpg) repeat-x top;
#000000