S
S
stimul7772021-05-22 13:33:08
css
stimul777, 2021-05-22 13:33:08

Why are the paths to the image not visible in CSS?

Hello everyone, the project is built on VUE CLI, when you try to set the path in styles using background: url("assets/image/img.svg"), the image simply does not load.
Tried a bunch of different variations with changing paths, still doesn't work.
lang="scss".
When inserting an image through a template in html, everything is loaded normally.
What could be the problem?

DECIDED THIS: url("[email protected]/assets/images/icons/buttons/btnDelitTable/hoverBtnRemove.svg");
Need to add ~

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xenonhammer, 2021-05-22
@xenonhammer

try typing in the address bar of your browser: "yoursite/assets/image/img.svg" if it shows a picture, then the problem is not in the path, if it doesn't show, then the path is wrong.

R
Roman Serdyuk, 2021-05-22
@budfy

It seems to me that you are specifying the path not relative to the css file, but relative to the document.

D
Doston Norpulatov, 2021-05-22
@Dos001

url("@/assets/image/img.svg")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question