简体   繁体   中英

how to repeat a small background image througout the page?

I want to set page background image my css code is-

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.

See demo here.

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

More Info:

http://www.w3schools.com/css/css_background.asp

You could use this background: #000000 url(images/body_bg.jpg) repeat-x top; And replace #000000 with the color, which ends your gradient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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