msm.oliveira
msm.oliveira

Reputation: 211

Insert an image that already exists in the project folder

I have this image in one of my project's folder: enter image description here

I wantto make a icon with that image, so i tried to call it like this: enter image description here

But it keeps occuring the error:

enter image description here

I think I have this error because I'm not giving any path.

Can you help me please?

Thanks

Upvotes: 1

Views: 710

Answers (2)

Rémi Becheras
Rémi Becheras

Reputation: 15232

Use this path in your css:

background: #ff9900 url("../img/Arrow_Circle_Right-32.png") no-repeat 10px center;

Please note the prefix for your base path: ../img/

Like that you go back from the css directory and then you enter in your img directory, that include your image.

Upvotes: 1

JBux
JBux

Reputation: 1404

The css file is searching in the same folder as it to find the background image.

Try:

background: url("../img/Arrow_Circle_Right-32.png")

The ".." goes back one folder, then the img accesses the image folder.

Upvotes: 1

Related Questions