I've been pondering the safety of exclusively using [type="text"]
instead of input[type="text"]
in CSS.
My concern is that when using input[type="text"]
, I'm unable to override it with a single class selector.
// HTML
<input type="text" class="has-error">
// CSS
input[type="text"] { color: black; } // has higher specificity than the one below
.has-error { color: red; } // won't override
Are there any other HTML elements that utilize the type
attribute? I have not encountered any other tags that use it so far.
Thank you