简体   繁体   中英

Background image not showing in CSS and HTML

I've tried to put a background image of a tileable galaxy on my website, but all its showing up is just red. I've tried removing the background color but then it just shows white. I've looked around but I'm just not sure what I'm doing wrong. Here's my code:

<style>
body {background-color:#800000;background- 
image:url("https://srv4.imgonline.com.ua/result_img/imgonline-com-ua- 
TextureSeamless-6dnmvt65oVOZjthV.png");
background-repeat:repeat;background-position:center center;
background-attachment:scroll;}
</style>

Any advice?

An image you are looking is not available on this below URL

https://srv4.imgonline.com.ua/result_img/imgonline-com-ua- 
TextureSeamless-6dnmvt65oVOZjthV.png

For example you can try something like this:

 html{ background: url('https://www.google.co.in/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png') no-repeat 0 0 scroll; background-color:#0C0C0C; background-size: 100% 100%; height:100%; width:100%; } 

Your image link is broken.

Try using another link, for your syntax is correct in the CSS.

Here is an example image link: https://thumb1.shutterstock.com/thumb_large/1479467/543360034/stock-photo-close-up-of-milky-way-galaxy-with-stars-and-space-dust-in-the-universe-long-exposure-photograph-543360034.jpg

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