Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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 CSS背景图像故障_Html_Css_Web_Background - Fatal编程技术网

Html CSS背景图像故障

Html CSS背景图像故障,html,css,web,background,Html,Css,Web,Background,html: } 但由于某些原因,它不会显示出来。我用background:和background image:用速记和url(“GoodAssTunes.jpg”)试过了。但它不起作用。 检查图片/GoodAssTunes.jpg没有问题 #Home { position: relative; background: url("../Pictures/GoodAssTunes.jpg") ; height: 800px; width: 100%; margin-left: -8px; margi

html:

}

但由于某些原因,它不会显示出来。我用
background:
background image:
用速记和
url(“GoodAssTunes.jpg”)
试过了。但它不起作用。

检查图片/GoodAssTunes.jpg没有问题

#Home {
position: relative;
background: url("../Pictures/GoodAssTunes.jpg") ;
height: 800px;
width: 100%;
margin-left: -8px;
margin-top: -8px;
z-index: 1;
background-size: 100%;

打开Google Crome

右键单击“打开查看页面”“源”或“检查元素”

并查看链接


它应该会打开图像

您的代码没有问题,您确定您的图像位于您所说的位置吗?或者,您是否打开它以查看图像是否已损坏?尝试查看Firebug,以查看图像是否显示为404代码良好!请检查大小写,因为有时CSS可能对文件名格式敏感
#Home {
position: relative;
background: url("../Pictures/GoodAssTunes.jpg") ;
height: 800px;
width: 100%;
margin-left: -8px;
margin-top: -8px;
z-index: 1;
background-size: 100%;
  #Home {
    position: relative;
    background: url("http://placehold.it/350x150") ;
    height: 800px;
    width: 100%;
    margin-left: -8px;
    margin-top: -8px;
    z-index: 1;
    background-size: 100%;
    }