L
L
lukman_q2021-04-08 12:29:36
React
lukman_q, 2021-04-08 12:29:36

The image is not connected in react in css, what should I do?

Changed: if I comment out this line, then I run it and include background in the code, then some kind of fig works, why
606eda5ea5050769000180.png

css код
background: url(./img/slider.jpg);

the image is in the img folder which is in the pubic folder for
606ecce7aec0b728776817.png
some reason gives an error, what's the problem

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rongeld, 2021-04-08
@rongeld

1. Change the "img" folder to . "images" and source = /slider.jpg
If it doesn't help
2. Apply inlan styles to the element {process.env.PUBLIC_URL + '/slider.jpg'}
3. Place the photo in the images folder in src and import import slider from './ images/slider.jpg' and inline {slider}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question