mercredi 1 septembre 2021

React image path

I have folder structure like:

images here

I have 2 code:

  1. components > cards.js

<img src="path here" />

  1. App.css

background-image: url("./images/img-1.jpg");

questions. Why the example 1 can access the public folder while 2 can't?




Aucun commentaire:

Enregistrer un commentaire