Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 背景图片:url();不起作用_Html_Css - Fatal编程技术网

Html 背景图片:url();不起作用

Html 背景图片:url();不起作用,html,css,Html,Css,html: 背景图像:url(“”) 这不会显示任何图像。不仅适用于此链接,也适用于所有其他链接 只有当图像被下载并且路径作为链接给出时,它才起作用。似乎是因为链接断开了。这一个有效 #横幅{ 背景图片:url(http://lorempixel.com/400/200); 填充:150px0; 文本对齐:居中; 背景尺寸:封面; 颜色:白色; } 我的页面 这是每个人都读到的重要一句话 尝试去掉引号:背景图像:url(https://usplash.it/1000/600/?random)

html:

背景图像:url(“”)

这不会显示任何图像。不仅适用于此链接,也适用于所有其他链接


只有当图像被下载并且路径作为链接给出时,它才起作用。

似乎是因为链接断开了。这一个有效

#横幅{
背景图片:url(http://lorempixel.com/400/200);
填充:150px0;
文本对齐:居中;
背景尺寸:封面;
颜色:白色;
}

我的页面
这是每个人都读到的重要一句话


尝试去掉引号:
背景图像:url(https://usplash.it/1000/600/?random);
@CBroe看起来像是一个对我不起作用的链接,可能是根据我的浏览器,没有为
usplash找到DNS服务器。它
。这不起作用。:c@banzay是否有其他链接可以生成像上面链接一样的随机图像。谢谢。我刚刚听说有一个叫做
自动生成随机图像url
的东西,像这样:)“有没有其他链接可以像上面的链接那样“生成随机图像”…这是我的问题。谢谢你的帮忙p@RizkiDPrast。如果您不知道该术语,请检查/。
<div id="banner">
  <h1>My Page</h1>
  <p>This is the important line everyone reads..</p>
  <a href="#">Enroll</a>
</div>
#banner{
  background-image: url('https://usplash.it/1000/600/?random');/*problem is here*/
  padding: 150px 0;
  text-align: center;
  background-size:cover;
  color: white;
}