Page 1 of 1

local image in css

Posted: Fri Nov 15, 2013 12:42 pm
by martin ratcliffe

Is there any way to use local images (media manager) in a css file?
For instance below would work if the file was in the images folder. Is there a way to reference images in an appery app in css?
background:url(../images/success.png)


local image in css

Posted: Fri Nov 15, 2013 1:33 pm
by Kateryna Grynko

Hi Martin,

Sure. If you download an image via Appery.io UI builder then it's available here:prefiles/views/assets/image/filename.png/prewhere 'filename.png' is a file name.


local image in css

Posted: Fri Nov 15, 2013 3:12 pm
by martin ratcliffe

thanks but that still does not work

the following ccs works by using a web based image
code
.toast-item-image-notice {
background:url("http://cdn3.iconfinder.com/data/icons/ellegant/64x64/9.png");
}
/code
but replacing the image with the following does not work. I have tried with quotes / without also.
code
background:url(../files/views/assets/image/camera30.png);
or
background:url(files/views/assets/image/camera30.png);
/code

I have checked that the file name exists in the source tab under the file structure and it is there. I have used the following code else where and this works so i am sure the file exists.

code
Appery('mobilebutton_85').css("background-image", 'url(' + Appery.getImagePath('camera30') + ".png" + ')');
/code


local image in css

Posted: Fri Nov 15, 2013 7:03 pm
by Maryna Brodina

Hello! Please try this way prebackground:url("../image/imageName.png");/pre perhaps this CSS style is overwritten. In this case try prebackground:url("../image/imageName.png") !important;/pre


local image in css

Posted: Mon Nov 18, 2013 9:27 am
by martin ratcliffe

Thanks that worked !