简体   繁体   English

背景图片未在CSS和HTML中显示

[英]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. 请尝试使用其他链接,因为您的语法在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 这是一个示例图像链接: 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

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

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