# Some CSS Styles Not Loading, Others Fine

**URL:** <https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133>\
**Category:** Templates & Frontend\
**Created:** [January 10, 2023, 7:42pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133 "2023-01-10T19:42:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![EGBeora](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/egbeora/32/11701_2.png) [@EGBeora](https://forum.djangoproject.com/u/EGBeora)\
**Post date:** [January 10, 2023, 7:42pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/1 "2023-01-10T19:42:03Z")

</div>

Hi all - For some reason I am having a VERY strange problem where some of my CSS is working via my static directory but some isn’t

The weird part about it is that when my coworker clones the repo himself it works perfectly fine on his PC

Here is the code itself

> **[project/project at master · EGBeora/project](https://github.com/EGBeora/project/tree/master/project)**
>
> master/project

Particularly having problems with index.html - I intentionally commented out the tags so that it is only pulling style from styles.css

When I uncomment the tags in index.html everything works and looks perfect, but when I try to pull from my static file the #posts and .post id and class styles are not working properly

I am still a student and this code is part of a course project for CS50W and I haven’t been able to figure out why my CSS isn’t functioning properly

I’d appreciate any help!

Django version 4.1.5  
Python 3.11.0

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 10, 2023, 8:29pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/2 "2023-01-10T20:29:38Z")

</div>

The first thing to do here is to verify that your browser is actually trying to load those files and not re-use files from local cache.

To help diagnosing this beyond that, you would need to post the console output from where you’re running this application (e.g. `runserver`), showing all the `GET` requests being issued for that page. You might also want to look at the “network” tab in your browser’s developer tools to see if your browser is even attempting to retrieve those files.

---

<div class="post-metadata">

**Author:** ![EGBeora](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/egbeora/32/11701_2.png) [@EGBeora](https://forum.djangoproject.com/u/EGBeora)\
**Post date:** [January 10, 2023, 8:32pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/3 "2023-01-10T20:32:12Z")

</div>

Hi Ken! Thanks for the fast response

```auto
[10/Jan/2023 12:30:20] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:21] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:22] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:23] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:23] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:24] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:25] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:26] "GET / HTTP/1.1" 200 2876

```

The GET requests look to be going smoothly, here is what my network looks like on a refresh (notice cache is disabled, found that advice in another thread but it didn’t help)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/djangoproject/original/2X/3/3b2b9aa5772dd2e955f62dc90c224dbc4f58bab4.png)

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 10, 2023, 8:38pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/4 "2023-01-10T20:38:45Z")

</div>

Notice that your log is _not_ showing any GETs for the css files.

---

<div class="post-metadata">

**Author:** ![EGBeora](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/egbeora/32/11701_2.png) [@EGBeora](https://forum.djangoproject.com/u/EGBeora)\
**Post date:** [January 10, 2023, 8:40pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/5 "2023-01-10T20:40:23Z")

</div>

```auto
[10/Jan/2023 11:43:56] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 11:43:56] "GET /static/network/styles.css HTTP/1.1" 304 0
[10/Jan/2023 12:30:19] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:19] "GET /static/network/styles.css HTTP/1.1" 304 0
[10/Jan/2023 12:30:20] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:21] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:22] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:23] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:23] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:24] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:25] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:30:26] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:31:14] "GET / HTTP/1.1" 200 2876
[10/Jan/2023 12:31:14] "GET /static/network/styles.css HTTP/1.1" 200 436

```

Sorry, I didn’t know exactly what you were interested in seeing but every now and then it does get the actual style.css itself

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [January 10, 2023, 8:56pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/6 "2023-01-10T20:56:22Z")

</div>

You could both check the “Sources” tab to verify that the right css file is being loaded, and then check the “Elements” tab - select one of the elements, and then verify what sources it’s using to style that element. (You can also look at the response for styles.css to see what it’s getting as the response from the server.)

---

<div class="post-metadata">

**Author:** ![EGBeora](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/egbeora/32/11701_2.png) [@EGBeora](https://forum.djangoproject.com/u/EGBeora)\
**Post date:** [January 10, 2023, 9:06pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/7 "2023-01-10T21:06:48Z")

</div>

Ah! Your comment made me realize I was looking in the wrong place

In the example code that is provided by the lesson, in layout.html the body block is wrapped in a div container with the class name “body” which was causing some sort of problem with my CSS, changing my body CSS to .body to target the particular class actually ended up giving me the exact solution I wanted

Sorry for the bother! I should have been able to spot that myself, I appreciate the help!

---

<div class="post-metadata">

**Author:** ![vawzenmaya](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/vawzenmaya/32/20327_2.png) [@vawzenmaya](https://forum.djangoproject.com/u/vawzenmaya)\
**Post date:** [April 2, 2024, 1:25pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/8 "2024-04-02T13:25:53Z")

</div>

Hey, am also facing the same problem, for my case, I first designed the frontend in a different file and it was working properly, on transfering to my django project, some css styles where not working while others were working properly, is there anyone who can help me!?

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [April 2, 2024, 1:28pm UTC](https://forum.djangoproject.com/t/some-css-styles-not-loading-others-fine/18133/9 "2024-04-02T13:28:21Z")

</div>

Welcome @vawzenmaya !

This topic has been marked as solved, so your post here is unlikely to attract attention. I suggest you open a new topic for your post, posting the details of the situation you are encountering.
