简体   繁体   中英

chrome not showing background image in parent div tag

I have one parent div tag containing two child div tags and i want to use a image as background. The css style of parent div tag is:

#maindiv
{
    width:55%;
    background-image:url(F:/sem5/web tech/13sand.jpg);
    overflow:hidden;
}

and the body is:

<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>

This code is showing the background in IE but not in chrome. Where and what is the problem??

Have you tried putting quotes around the image's url?

#maindiv
{
    width:55%;
    background-image:url('F:/sem5/web tech/13sand.jpg');
    overflow:hidden;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM