[英]Background image not showing in CSS and HTML
我试图在我的网站上放置一个平铺星系的背景图像,但是显示的只是红色。 我试过删除背景色,但它只显示白色。 我环顾四周,但是我不确定自己在做什么错。 这是我的代码:
<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>
有什么建议吗?
您正在寻找的图片在以下网址上不可用
https://srv4.imgonline.com.ua/result_img/imgonline-com-ua-
TextureSeamless-6dnmvt65oVOZjthV.png
例如,您可以尝试如下操作:
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%; }
您的图片链接已损坏。
请尝试使用其他链接,因为您的语法在CSS中是正确的。
这是一个示例图像链接: 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.