Answer the question
In order to leave comments, you need to log in
Problem compiling sass?
During layout, in files with the .scss extension, some blocks were given the background-image property with the following path: ../../img/img-name.jpg .
When compiling, it turns out that chrome cannot find this image, referring to the wrong path.
The project structure is as follows:
css/
| - style.css
sass/
| - style.scss
| - blocks/
| - block_name.scss (задаю фон здесь)
img/
| - backgrnd_img.jpg
index.html
Answer the question
In order to leave comments, you need to log in
Unfortunately Sass doesn't know how to resolve such paths. There is a problem, they know about it, but they don’t solve it yet (sass developers, I mean).
I made it a rule to write absolute links
/img/img-name.jpg
Yes, there are disadvantages, but somehow we live for now.
../img/img-name.jpg.
and it is better to have only 2 folders css and sass then there will definitely be no problems)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question