简体   繁体   中英

CSS Background Image Trouble

html:

<div id="Home"></div>

css:

#Home {
position: relative;
background: url("../Pictures/GoodAssTunes.jpg") ;
height: 800px;
width: 100%;
margin-left: -8px;
margin-top: -8px;
z-index: 1;
background-size: 100%;

}

But it wont display for some reason. I've tried it with background: and background-image: with the shorthand and just url("GoodAssTunes.jpg") . But it doens't work.

http://jsfiddle.net/JD2ft/ It works fine see

No problem check with Pictures/GoodAssTunes.jpg

  #Home {
    position: relative;
    background: url("http://placehold.it/350x150") ;
    height: 800px;
    width: 100%;
    margin-left: -8px;
    margin-top: -8px;
    z-index: 1;
    background-size: 100%;
    }

Open Google Crome

rightclick open view page source or Inspect element

and see the link

it should open the image

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