Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.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 背景图形不显示_Html_Css - Fatal编程技术网

Html 背景图形不显示

Html 背景图形不显示,html,css,Html,Css,我的身体背景没有显示出来。半小时前它还可以正常工作,我不明白为什么它不能在IE 9或Chrome中显示。它在Expression Web 4的预览中显示良好 它应该是这样的>> HTML代码: 有人看到它有什么问题吗?写为- #body-1 { width: 870px; height: 500px; margin: 0 auto; background: url('images/Chinatown-bg.png') #9c0000 no-repeat left to

我的身体背景没有显示出来。半小时前它还可以正常工作,我不明白为什么它不能在IE 9或Chrome中显示。它在Expression Web 4的预览中显示良好

它应该是这样的>>

HTML代码:

有人看到它有什么问题吗?

写为-

#body-1 {
    width: 870px; height: 500px;
    margin: 0 auto;
    background: url('images/Chinatown-bg.png') #9c0000 no-repeat left top;
}
编辑:

它一定藏在那里了。尝试为ID设置一些高度-

请点击这里,试试这个

#body-1 {
    width: 870px;
    margin: 0 auto;
    background: #9c0000 url('images/Chinatown-bg.png')  no-repeat 0 0;
}
Hi现在定义溢出:隐藏;在你的身体里-1号

像这样

#body-1 {
   overflow:hidden;
 }
-------------- ------------ 二是


但我想添加更多的内容,它将超过500px。我可以使用自动高度吗?谢谢,但自动工作正常,除非有理由不使用它?@TeaDrinkingGeek定义最小高度只是为了在容器文本较少时使背景图像可见……:溢出:隐藏删除我想添加的所有其他内容。e、 g.内容更多。@TeaDrinkingGeek不习惯于此body-1:after{content:;clear:both;overflow:hidden;display:block;}并在after中清除body-1标记,现在检查我更新的第二个选项。。。。。。。。。。
#body-1 {
    width: 870px;
    margin: 0 auto;
    background: #9c0000 url('images/Chinatown-bg.png')  no-repeat 0 0;
}
#body-1 {
   overflow:hidden;
 }
#body-1:after{
content:'';
  clear:both;
  overflow:hidden;
display:block;
}