Why is it that the input[type=number]
selector in the following example takes precedence over the .num
class selector? Shouldn't they both have equal specificity?
I assumed that the one declared later would overwrite the earlier one.
input {
width: 100px;
}
input[type=number] {
border: 2px solid green;
}
.num {
border: 2px solid red;
}
<input type="number" class="num"> Why isn't the border red (as specified by .num)?