How to load image background in Magento CMS page with php-url path?

css, magento, magento-1.7, php

Solution

You put in a relative or absolute URL. Also, you should put it in a class, not inline.

.imageclass {
  background: url(/media/wysiwyg/images_cms/mybackground.png);
}

See the MDN docs for `background-image`

Problem

Inside a CMS block in Magento 1.7.0.2 I am trying to get a background image the code that I use in the HTML EDITOR for the block is this: ``` <div class="imageclass" style="background: url()"> </div> ``` Inside the url() I should place the exact url of my image. But the problem is that if I load from WYSIWYG folder in CMS I DON'T get a correct path So what kind of path should I put into the url below ? ``` <div class="imageclass" style="background: url()"> </div> ``` My background image is on /media/wysiwyg/images_cms/mybackground.png

Original source