0

I have a div with more buttons and I cannot add an image to it.

Html:

<div class="menu_border" style="height: 460px; width: 290px;">

</div>

CSS:

.menu_border {
     float: left;
     border: 5px groove;
     margin-left: 70px;
     text-align: center;
     background-image:url('images\generale\bkgmenu.jpg');
}

My css and source codes are in the main folder. There is the folder images->generale and the images. I've tested the path, is correct. I've tried to add the image as normal <img> and it worked.

It does not work as background.

Mukul Kant
  • 7,074
  • 5
  • 38
  • 53
  • Its working for me. can you please add fiddle – Mukul Kant Aug 17 '16 at 09:58
  • Code works fine: https://jsfiddle.net/g5vkgucf/ Maybe the image URL is wrong? Check the network tab in your browser's debugging tools to see what the request was. – David Aug 17 '16 at 09:58
  • I think path should be like `background-image:url('..\images\generale\bkgmenu.jpg'); ` in your case – Mukul Kant Aug 17 '16 at 10:00

1 Answers1

1

ur code needs to change like this

background-image:url('images\generale\bkgmenu.jpg');

to

background-image:url('images/generale/bkgmenu.jpg');

image will taken this format

Gaurav Aggarwal
  • 9,809
  • 6
  • 36
  • 74
bala
  • 177
  • 2
  • 13