1

Im stil develop the MVC project i have background image, iam publish project in my local saver, but not see in my saver my image, but image realy work my pc , what is the problem ? please give me a solution?

Image Path

 <body  style=" background-image:url(../../img/home_bg.jpg);>
Codeone
  • 1,173
  • 2
  • 15
  • 40
  • Where is the `img` directory located relative to the root of your website? What is the request path of the page you're visiting? How did you come to decide to use `../../` in your image path? – Dai Nov 10 '15 at 06:36
  • its get the auto , path make a auto – Codeone Nov 10 '15 at 06:41
  • 1
    Have a look at this thread http://stackoverflow.com/questions/851724/css-background-image-what-is-the-correct-usage and this one http://stackoverflow.com/questions/5730528/in-asp-net-mvc-what-is-the-correct-way-to-reference-images-inside-of-css – J-D Nov 10 '15 at 06:43
  • Sir, thanks Im try to this . – Codeone Nov 10 '15 at 06:45

2 Answers2

3

Use Relative Path using "/"

/RootDirectory/img/home_bg.jpg

If image folder is within the RootDirectory Then Use Below

/img/home_bg.jpg
Ravi
  • 316
  • 7
  • 17
0

I found the solution,

finaly its working

 url('/img/home_bg.jpg');
Codeone
  • 1,173
  • 2
  • 15
  • 40