Shahrazed
Shahrazed

Reputation: 41

How to use image in my ionic app?

I used an image as background in my ionic app using this css code

.contentcolor{
  background-image: url('../../assets/Capture3.PNG');
  background-repeat: no-repeat;
  background-position: center;
  background-size: full;
}

But when I run my app on emulator or hard device the image doesn't appear. And when I inspected I found this :

enter image description here

How can I solve it?

Upvotes: 1

Views: 68

Answers (1)

Gerben den Boer
Gerben den Boer

Reputation: 124

Where are your images located? I assume in the assets folder? I think you are referencing to a non-existing file.

EDIT: Try using: background-image: url('./../assets/Capture3.PNG');

Upvotes: 1

Related Questions