I have a locally hosted web app, whose root directory looks like this:
|- index.php
|- img
|-physics.svg
When I access http://localhost/img/physics.svg
, the vector image is successfully displayed on the page. When I access http://localhost/index.php
, which includes the line:
<div style="...; background-image: url(./img/physics.svg)"></div>
The browser shows a status 200 in the Network tab of the dev tools. However, the image loaded appears to be a blank. Is there any explanation/solution to this problem?
Also, this problem only happens on localhost. When I deploy the app to gcp, it works just fine, showing the images as normal.