Html CSS背景图像故障
html: } 但由于某些原因,它不会显示出来。我用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
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%;
}