# Background url

**URL:** <https://forum.ionicframework.com/t/background-url/112020>\
**Category:** ionic-v3\
**Created:** [November 14, 2017, 1:45am UTC](https://forum.ionicframework.com/t/background-url/112020 "2017-11-14T01:45:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smirnova](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/smirnova/32/103393_2.png) [@Smirnova](https://forum.ionicframework.com/u/Smirnova)\
**Post date:** [November 14, 2017, 1:45am UTC](https://forum.ionicframework.com/t/background-url/112020/1 "2017-11-14T01:45:07Z")

</div>

Hi there,

My trouble is that when I print the image url like so

> {{ imagesFolder + selectedSampleType.image }}

or like so

> src=“{{ imagesFolder + selectedSampleType.image }}”

it works. But I need to use it as a background for the div, which returns “undefined” for me:

> [ngStyle]=“{‘background’: ‘url(’ + imagesFolder + selectedSampleType.image + ‘)’}”

What am I doing wrong here?

Thanks,  
Olga

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 10:03pm UTC](https://forum.ionicframework.com/t/background-url/112020/2 "2021-07-19T22:03:55Z")

</div>

Closed on July 19, 2021, 10:03pm UTC


