Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49215

Image-background in CSS

$
0
0

@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.png

And 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 :slight_smile:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>