Skip to content Skip to sidebar Skip to footer

Css File Is Not Loaded

I have a simple Django app and I cannot figure out why my CSS file is not loaded. Any help to nail the problem is appreciated! The error that I am getting is this: GET http://127.0

Solution 1:

I figured it out myself:

the problems was the setting.py file where static folder is defined. I commented out STATIC_ROOT and it worked. I guess they cannot co-exist.

Solution 2:

I am not the smartest when it comes to HTML but I know a few things. This may not change much but I can tell you how I do my linking.

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

This is all I have done with my files so far, but I haven't ever tried to make a huge one. This works but everything, including the "% Static" I have never added to mine. Again I hope this helps but I don't know if it will change anything.

C:\Users\(User)\Desktop\Web\(ProjectName)\css\CSS

It Depends on where your HTML file is set in your project. Say I have this file structure.

C:\Users\(User)\Desktop\Web\Projects\HTMLProject\CSS\MainCSS\CSS.css

If your CSS file is in the MainCSS folder, but the HTML file is in your HTMLProject file, you would need to do this instead.

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

The more subfolders you have the more you need to explain to your computer how to get there.

Post a Comment for "Css File Is Not Loaded"