2

Im trying to get an background image displayed in a button div but its not showing up.

Changing background-image to background-color works and it displays a color in the correct spot the image should of been.

Im drawing a blank here: jsfiddle

This is the piece of code:

.strawberry {
height:65px;
width:100%;
background-image: url('src/bg_button.jpg');
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center; 
overflow:hidden;
}

Im new to html5 so please be gentle.

Black Sheep
  • 6,604
  • 7
  • 30
  • 51

2 Answers2

2

It is possible that you are not in the correct folder try this:

.strawberry {
    height: 65px;
    width: 100%;
    background: url("../src/bg_button.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    overflow: hidden;
}
Anonymous
  • 11,748
  • 6
  • 35
  • 57
I am Cavic
  • 1,115
  • 1
  • 10
  • 22
0

In a jsfiddle, an image referenced that way will need to be gotten from somewhere on the web. When I load your fiddle in Chrome, I get 404 not found errors:

Failed to load resource: the server responded with a status of 404 (Not Found) http://fiddle.jshell.net/m6AnC/13/show/src/bg.png http://fiddle.jshell.net/m6AnC/13/show/src/header.jpg http://fiddle.jshell.net/m6AnC/13/show/src/bg_button.jpg

See: Adding images in JSfiddle

Community
  • 1
  • 1
artlung
  • 33,305
  • 16
  • 69
  • 121