Search code examples
htmlcssdjangocolors

CSS button won't change color


I'm trying to edit a template I've downloaded on the internet, by changing some colors. However, when I change the color in the css file, it doesn't change it on the website:

HTML:

.user-panel {
    float: right;
    font-weight: 500;
    background: #ffb320;
    padding: 8px 28px;
    border-radius: 30px;
    }
    <div class="user-panel">
        <a href="https://example.com" target="_blank">Link</a>
    </div>

This is how I import the .css file:

<link rel="stylesheet" href="{% static 'css/style.css' %}"/>

So what I did was changing #ffb320 to #cc0000 to have red instead of yellow, saved the file, and reloaded the page, but the color didn't change. Same goes for font size, etc...

The only thing that did work was using style='font-size:20px' for the font size.

What am I doing wrong here?


Solution

  • This happens because of the cache so, you can do like:

    <link rel="stylesheet" href="{% static 'css/style.css' %}?version=55"/>
    

    Also, do run the command:

    python manage.py collectstatic