I have learned that the universal selector should be the least priority selector. However, in the following code, it turns out that the first line is blue, second line is white, and last line is brown. Since I put class selector as red for the whole div, why aren't all lines brown?
I'm thinking that since they are all matched with class selectors (same priority), the last one defined should take priority, which is the red one, but it is not the case here.
Here is the HTML/CSS code:
<head>
<style type="text/css">
.blue {
color: blue;
}
* {
color: whitesmoke;
font-size: 5mm
}
.ho {
color: rgb(181, 194, 40)
}
.divo {
border: 5px outset;
color: brown;
text-align: center
}
</style>
</head>
<body>
<div class="divo">
<h1 class="blue"> this is BLUE </h1>
<h2> this is YELLOW </h2>
hello
</div>
</body>