0

I uploaded css files in the blob storage. Now I am trying to access that files in the browser directly

through the blob URI. But my problem is the images which are referenced in the css file. These images

are referenced by the relative address. There are lots of images in my css file. So that`s why is there

any alternative for this so that without upload those images in the blob we can show it in the browser ?

Tom Rider
  • 2,747
  • 7
  • 42
  • 65
  • Where are the images? They must be uploaded _somewhere_ in order for you to be able to reference them. Can you not use a full/direct URL to them instead of a relative address? – Kjartan Aug 26 '12 at 11:19

1 Answers1

1

When you insert relative path in your CSS, the relative path will use the location of CSS as it root and then create the path. In your case, because your CSS is located at Azure Blob storage the relative path in your your CSS will all look for your Azure Blob storage as root. You hit the problem because your images are located at Azure VM and your CSS is located at Azure Blob storage. This is a by design behavior for CSS as described multiple places i.e.: Is a relative path in a CSS file relative to the CSS file?

The bottom line if that if you are using CSS and referencing any content to it, it should reference to same web server. The folder/containers could be changed and then you can reference them correctly in your relative path.

To solve this problem you would need to copy all your images to same container at Windows Azure Blob storage and then you can just use "imagename.imageextension" any where in CSS.

Community
  • 1
  • 1
AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65