Right, being a Python & Django student using VSC so therefore, in the interest of not having a nervous breakdown here, how on earth do other VSC users import CSS files into their HTML/PHP documentation?
This is clear a server issue (hence why this is being posted here and not Stack Overflow) because as far as I'm concerned, my code is correct.
- Created a HTML document with the filename
base.html
and added{% load static %}
at the top of said document. I have then created a HTML document & added{% extends 'base.html' %}
at the top. - Created a
static
folder in the root directory, a sub-director folder ofcss
and created a CSS document with the filenamemain.css
- Went into the Settings, added
STATICFILES_DIR = [BASE_DIR / "static"]
and confirmed thatSTATIC_URL = "static/"
was present - Confirmed base & path directory as
BASE_DIR = Path(__file__).resolve().parent.parent
- With all this confirmed, I went into the HTML document and uploaded the stylesheet in the following manner
<link rel="stylesheet" href="{% static 'css/main.css' %}">
which can be seen when I go to inspect the document from the browser.
However, despite all this, the server is still completely ignoring any CSS documentation, as a test, I have set the <body>
tag to a different background-color
and low and behold. I don't see a single shade of blue.
I'm genuinely at a loss as to how - despite following the documentation to the letter - I get a different result. As I started earlier, its clearly a server issue because unless I'm going crazy (which is hardly surprising considering I have to work with VSC) I fail to see what I'm doing wrong here.
This is clear a server issue
- It is not. It's a development environment and therefore off topic. You can post it on SO once your suspension ends.