-1

The background image for div is not working. I have read through all the solutions that you have aldready given. Please help me.

<div class="a" style="background-image:url(/img/meetup/CloudOps%20meetup.jp‌eg);" onclick="return true">
</div>
<div class="b"></div>
Arjan Knol
  • 942
  • 5
  • 20
Rishi Dev
  • 1
  • 1
  • 1
    We're going to need a bit more info, just from this, my best guess is to try and see if your image actually exists in the directory you've specified – Lennart May 16 '17 at 09:45
  • yes,it is available.
    @LennartHase
    – Rishi Dev May 16 '17 at 09:51
  • We're going to need your relevant HTML and CSS, otherwise, there's nothing more we can do. The code you've posted should work, so the problem will be elsewhere within your code. Make sure that your `div` has a height and width set – Lennart May 16 '17 at 09:55
  • html code -

    css-.scene { width: 460px; height: 400px; margin: 30px; float: left; } @LennartHase
    – Rishi Dev May 16 '17 at 10:00
  • 1
    Please put the code in your question and read the following links: https://stackoverflow.com/help/how-to-ask , http://stackoverflow.com/help/mcve – Arjan Knol May 16 '17 at 10:01
  • please look at the console (browser debugger). is it returning the "not found" error on that image? – Yudi Chang May 16 '17 at 10:02
  • @RishiDev - Please check out the following link - http://stackoverflow.com/questions/43996209/why-cant-i-set-a-background-image – Faizal May 16 '17 at 10:07
  • No the image is available@YudiChang – Rishi Dev May 16 '17 at 10:08
  • 1
    @RishiDev okay, based of that your code is absolutely fine, which means that the image does not exist at the path you've specified, you can verify this by checking the console as Yudi Chang said, or looking at the network tab in the inspector, the file will return a 404, if it's not found. – Lennart May 16 '17 at 10:08
  • yeah, totally forgot about the network tab. like @Lennart said, open network tab, refresh the page, and check if the image load or not (you can also filter it to "Img" to make it easier to check). – Yudi Chang May 16 '17 at 10:20

2 Answers2

0

Set the background size :

body 
{
background : cover;
background: url("http://quizdoo.com/wp-content/uploads/qc-images/58d2957b47354.jpg"); 
}
Arun Kumar
  • 128
  • 7
-1

You can do:

<div style="background-image:url(/img/meetup/CloudOps%20meetup.jpeg);"> 

</div>

You must specify height and width for the background image to be visible. Hope this helps.

Adam
  • 77
  • 10