In which order are CSS styles applied?
- by citronas
I have the following HTML.
<ul>
<li>
<a>asdas</a>
</li>
</ul>
In my CSS stylesheet I have general settings for the a tag, and several hundered lines later settings for ul li a.
Like this:
a:link
{
color: red;
}
...
ul li a
{
color:blue;
}
Firebug tells me, that first the color:blue is loaded, and afterwards overriden by color:red
So far I've always thought, that the order of loading css files and the order of style inside a single css file tell the browser how html elements should be formatted. Unfortunately I'm now experiencing it vice versa.
So tell me, how must I correct my style to achieve the a tag inside the li to be rendered blue and not red?