Daniel Constantinescu Daniel Constantinescu - 3 months ago 8
CSS Question

Cannot add background image to my <div>

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.

Answer

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