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.
Carl0s1z
4,7237 gold badges34 silver badges49 bronze badges
-
There's nothing wrong with your code, are you sure your image is in the spot you say it's in? Alternatively, have you opened it up to see if the image is corrupt?Ming– Ming2014年04月14日 07:43:41 +00:00Commented Apr 14, 2014 at 7:43
-
Try looking in Firebug, to see if the image is coming up as a 404Andrew Newby– Andrew Newby2014年04月14日 07:46:16 +00:00Commented Apr 14, 2014 at 7:46
-
code is good! Check the case as sometimes CSS can be sensitive to filename formattingjkell311– jkell3112014年04月14日 07:48:10 +00:00Commented Apr 14, 2014 at 7:48
2 Answers 2
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%;
}
answered Apr 14, 2014 at 8:11
codefreaK
3,6627 gold badges38 silver badges66 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Open Google Crome
rightclick open view page source or Inspect element
and see the link
it should open the image
Comments
lang-html