Search code examples
csswindowshtmlwindows-8winjs

Windows 8 - Use image for background


I'm creating my first Windows 8 app and I have a problem with CSS!

I have a folder images and background texture bg.png inside it. Also, stylesheet is in css folder.

CSS:

#contenthost {
  height: 100%;
  width: 100%;
  background: url("../images/bg.png") repeat;
}

But nothing happen! I tried background: #999 which works. What should I do?


Solution

  • I tried your example with path to the image relative to the app root and it worked without any issues:

    #contenthost {
        height: 100%;
        width: 100%;
        background-image: url('/images/logo.png');
        background-repeat: repeat;
    }
    

    In terms of your code this would be:

    #contenthost {
        height: 100%;
        width: 100%;
        background: url('/images/bg.png') repeat;
    }