Sunday, 17 November 2013

How to insert background image in div ?


If You Want to Insert an Image in DIV . 

Then You Just Try This .

<div style='background:url('PATH_OF_IMAGE');background-size:100%;' ></div>

Now  You GET BACKGROUND IMAGE in DIV.

2 comments:

Guy Williams said...

This doesn't work for me - I am trying to set my header (a flat png image) as a background image for the header to enable me to put social media links on top of the header image. I know it can be done but when I try it this way No image shows. When I do it in the CSS nothing shows. I'm beyond stuck....Any Help?

KAPIL KARDA said...

you can use !important in your css property and set height and width of image in css