V
V
Vasek19992018-09-04 20:27:28
css
Vasek1999, 2018-09-04 20:27:28

PHPStorm: how to include external stylesheet from site root?

Please tell me why PhpStorm does not see the style file that is included in this way:

<link rel="stylesheet" type="text/css" href="/styles.css">

When I start OpenServer, the styles work fine, and the built-in PhpStorm server does not apply the style file in any way. I shoveled the Internet, but either I’m formulating the request in the wrong way, or this problem has an obvious solution that I didn’t think of :) untitled1, i.e. the path looks like this:
localhost:63342/untitled1/index.html

And when you try to open the source code of the page in the browser and click on the link to the styles, this path appears:
view-source: localhost:63342/styles.css

Those. the untitled1 part is magically lost and the browser does not see the styles! :) Is it possible to correct this misunderstanding?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-09-04
@webinar

for localhost:63342/untitled1/index.html
localhost:63342 and there is root
not magic, but according to the specification. Everything works exactly as it should. Another question is what you need differently, but that's another song. Set up a storm so that there is no untitled1 in the url. Smoke manuals: https://www.jetbrains.com/help/phpstorm/defining-m...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question