I am trying to style a website using a stylesheet.css file.
In one of my html pages, I have the <link rel="stylesheet" href="stylesheet.css"> element. The css file is in my templates folder (image):
When I start the application and go to a page, The console reads:
"GET /home/stylesheet.css HTML 1.1/" 200
But the page doesn't appear to load correctly (meaning none of the CSS settings are applied). I am using repl.it to run this website.
Here is the link to the repl: sm--supermechm500.repl.it [REPL.IT]
Here is my css file:
@import url('https://fonts.googleapis.com/css?family=Aldrich&display=swap');
body {
align-items: center;
text-align: center;
background-color: #000000;
width: auto;
height: auto;
font-family: 'Aldrich', sans-serif;
}
I have already reviewed this question: Application not picking up css file , but I didn't quite understand the answer provided, or the question's code.
What is the proper way to make flask render a page using a stylesheet?
200in"GET /home/stylesheet.css HTML 1.1/" 200indicates that the file has been loaded. What do you mean bythe page doesn't appear to load correctly? Are none of your CSS settings applied, or is it just an issue with the font? Try to browse to the CSS file directly with your browser and check the content.