0

我有一个包含两个子 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 中不显示。哪里有什么问题??

4

1 回答 1

3

您是否尝试过在图片的网址周围加上引号?

#maindiv
{
    width:55%;
    background-image:url('F:/sem5/web tech/13sand.jpg');
    overflow:hidden;
}
于 2012-08-05T08:32:01.173 回答