我有一个包含两个子div标签的父div标签,我想使用图像作为背景。 父div标签的css样式是:
#maindiv
{
width:55%;
background-image:url(F:/sem5/web tech/13sand.jpg);
overflow:hidden;
}
身体是:
<body background="National Geographic Wallpapers 022.jpg" >
<center >
<div id="maindiv" >
<h2 style="background-color:#191970;font-family:Verdena;color:white;height:91px;font-size:80px;">Gagandeep Kaur</h2>
<div style="float:left;width:37%;">
<table border="0">
<tr><a style="cursor:pointer;text-decoration:none;font-size:28px" href="javascript:filldata('ginfo');" >General Information</a><br/><tr>
<tr><div id="ginfo"></div></tr>
<tr><a style="cursor:pointer;text-decoration:none;font-size:28px" href="javascript:filldata('ainfo');" >Academic Information</a><br/></tr>
<tr><div id="ainfo"></div></tr>
<tr><a style="cursor:pointer;text-decoration:none;font-size:28px" href="javascript:filldata('h');" >Hobbies</a><br/></tr>
<tr><div id="h"></div></tr>
<tr><a style="cursor:pointer;text-decoration:none;font-size:28px" href="javascript:filldata('aim');" >Aim</a></tr>
<tr><div id="aim"></div></tr>
</table>
</div>
<div style="float:right;width:63%;">
<img src="2011-08-04 18.31.38_1.jpg" align="right" width="300px" height="500px">
</div>
</div>
</center>
</body>
此代码显示IE中的背景但不显示chrome。 哪里有什么问题??
答案 0 :(得分:3)
您是否尝试在图片的网址周围加上引号?
#maindiv
{
width:55%;
background-image:url('F:/sem5/web tech/13sand.jpg');
overflow:hidden;
}