Quite confused here.
<html>
<head>
<style>
.one
{
font-weight: normal;
}
.two
{
font-weight: bold;
}
</style>
<body>
<p class="two one"> Test!!!!!</p>
</body>
</html>
Why is Test bold? I’m clearly defining “normal” for the font weight “after” the bolded one?
I thought CSS did the cascading based on what order the classes were added right? Not the location in the file?
CSS doesn’t care what order you specify the classes inside your
classattribute.Here, both classes have equal specificity, so the class lower down in your CSS “wins”.
Specifics on CSS Specificity – a well written article explaining specificity.
Pointless demo of your code: http://jsfiddle.net/JwhmE/