简体   繁体   English

如何在整个页面上重复一个小的背景图像?

[英]how to repeat a small background image througout the page?

I want to set page background image my css code is- 我想设置页面背景图像我的CSS代码是-

background:url(images/body_bg.jpg) repeat-x top; 

but the image size is not as large as web page thats a thin strip only and gradient color too.so how can i repeat the image so that it will occupy whole background?As I said it is gradient so I can't hardcore the background color. 但是图像的大小不如仅是一条细条和渐变颜色的网页那么大。所以我该如何重复图像以使其占据整个背景?正如我所说的那样,它是渐变的,所以我无法对背景进行硬化颜色。

You could use this background: #000000 url(images/body_bg.jpg) repeat-x top; 您可以使用以下background: #000000 url(images/body_bg.jpg) repeat-x top; And replace #000000 with the color, which ends your gradient. 并用颜色替换#000000 ,以结束渐变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM