读书人

css设置的背景图片为何无法显示?解决办

发布时间: 2012-01-02 22:40:04 作者: rapoo

css设置的背景图片为何无法显示?
css内容如下:
#houtaiall /*后台主容器*/
{
width: 798px;
height: 598px;
margin: 0px auto;


}

#houtaitop
{
width: 798px;
height: 75px;
margin: 0px auto;
background:url(../image/htbj1.gif) right top no-repeat;


}

#htdaohan /*导航*/
{
width: 796px;
height: 30px;
margin: 0px auto;
}

#zjleft /*中间左边*/
{

width: 99px;
height: 467px;
float:left;

}
#zjright /*中间右边*/
{
width:697px;
height:467px;
float:left;
}
#houtaiyj /*后台页脚*/
{

width: 796px;
height: 28px;
margin: 0px auto;
}


aspx文件如下:
<form id= "form1 " runat= "server ">
<div id= "houtaiall ">
<div id= "houtaitop " > </div>
<div id= "htdaohan "> </div>
<div id= "zjleft "> </div>
<div id= "zjright "> </div>
<div id= "houtaiyj "> </div>
</div>
</form>


htbj1.gif图片为796*76px

大家帮忙看看呀,急!!!

[解决办法]
你的文件 的路径
background:url(../image/htbj1.gif) right top no-repeat;
对于../image/htbj1.gif这个地址的相对路径要 确保正确

读书人网 >asp.net

热点推荐