@st3ph31 wrote:
Hello,
I’m trying to display a background-image in my Ionic app and I’ve tried all the paths that I could imagine but that doesn’t work… I found some topics on this subject but these were unefficient…
I have my picture in:src/assets/pictures/header.png
And I put the CSS class in:
src/app/app.scss
Finally my class is:
.headerBackground {
background-image: url(’…/assets/pictures/header.png’);
width: 100%;
height: 20%;
background-size: contain;
background-repeat: no-repeat;
}For the path, I tried:
/assets/pictures/header.png
assets/pictures/header.png
…/assets/pictures/header.png
/pictures/header.png
…/pictures/header.pngAnd many many other solutions but it stil doesn’t work!
Can you help me to figure out how to solve this problem? It makes me crazy!!
Thanks in advance
Posts: 1
Participants: 1