About Relative Paths for Web Resources
For HTML, the relative paths are relative to the directory of the HTML file:
<!-- /index.html -->
<img alt="" src="img/the-image.jpg" />
For JavaScripts, the relative paths are still relative to the directory of the HTML file:
/* /js/main.js */
var img = new Image();
img.src = 'img/the-image.jpg';
But for CSS, the relative paths are relative to the directory of the CSS file:
/* /css/main.css */
body {
background: url(../img/the-image.jpg);
}
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent app
For Django websites that use cookies.
Django App for You