1

I use MVC4 and minifying my CSS files, but a div tag that have a background image isn't showing the image in release mode. When I inspect the page with firebug, it says "Failed to load image..."

It works in debug mode, but not in release mode.

What is wrong with my div background images?

The physical path on my project is "\Content\themes\default\images\" and the CSS looks like this:

.headerlogo {
    background-image: url('images/logo.png');
    background-repeat: no-repeat;
    background-size: auto auto;
    height: 28px;
    width: 127px;
    margin-top: 25px;
 }

I tested the following:

  background-image: url("themes/default/minified/images/logo.png");

It works, but if you create a sample MVC4 internet application and look at it's CSS, the image address is:

url(images/ui-bg_flat_0_aaaaaa_40x100.png)

Why doesn't this work for me?

Colin Bacon
  • 14,767
  • 7
  • 46
  • 66
motevalizadeh
  • 4,259
  • 11
  • 49
  • 89
  • Refer to this question, its likely the same issue: [Images Not Working][1] [1]: http://stackoverflow.com/questions/11355935/mvc4-stylebundle-not-resolving-images – Hao Kung Jun 18 '13 at 23:36

0 Answers0