Answer the question
In order to leave comments, you need to log in
Pictures and fonts are not loading correctly in PHPStorm, what should I do?
The fact is that everything worked in openserver, but I decided to switch to PHPStorm. Installed the interpreter configured everything but does not work.
PHP files run ok. But the paths to the files are not defined in the same way,
in openserver I just set it like this: "../images/image.png" and everything worked. Here the project is located in a separate folder and the file path is considered from the ip address. That is, the file path should be like this: " localhost:63342/project/images/slide1.png ",
and it's like this: " localhost:63342/images/slide1.png "
The path to the project: C:\Users\Daniil\PhpstormProjects\ project
Structure:
index.php
images
pages/product.php <--- image is requested from here
Answer the question
In order to leave comments, you need to log in
You just need to brush up on URL addressing
./ means to search in the current directory.
../ - means to go up a level and search there.
Suppose the following structure (you didn’t show yours, you have to guess):
project/
|-images/
| |
| \-slide1.jpg
|
|-css/
| |
| \-styles.css
|
\-index.html
.slide {
background-image: url("../images/slide.jpg");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question