Why is a CSS file not changing the colors of HTML tags on Django project?

I've been working on adding css styles to my django web project, but I noticed something odd I can't understand.

My page is succesfully adding or removing a gif when I add it or remove it in my css file, but the color of my labels, for instance, doesn't change. This is my simple css file that works this way:

li a {
    color: green;
}
body {
    background: white url("images/background.gif") no-repeat;
}

When in my browser, I can see if I delete the second statement, the gif no longer appears, but whether I delete or not the first one, all text is still black. I also tried this:

h1 a, h2 a {
     color: #C25100;
}

But it works the same, it doesn't change any text, and the document has many different tags, and none is affected.

I include the css in my html file like this:

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

When I first figured it out, I had bootstrap linked too, but I removed it and it changed nothing.

Upvotes: 1

Views: 1326

Answers (2)

Anton G
Anton G

Reputation: 1

Actually I had the same problem, turns out that I didn't close one of curly braces in .css file

Upvotes: 0

Faisal Manzer
Faisal Manzer

Reputation: 2129

Color isn't changing because h1 a means a inside h1. I guess you should change that to h1, a this means h1 and a. Read more here.

Upvotes: 1

Related Questions