I want use img
tag in my Next app but it doesn't work. That is img
tag :
<img src={'/public/img/cats.png'} alt="cats img" />
I searched a lot but I didn't find anything that works.
oh, It's very simple, except for the other ways, this is the way Ken is very interested in first import image like this :
import myImg from '../../public/img/car.png';
and use <img src={myImg.src} alt="car" />
or <img src={myImg} alt="car" />
You can right click on your image and "copy relative path" copy address and instead of "" , use "/" and it worked