以下哪个 CSS 选择器更快?
input[type="submit"] {
/* styles */
}
或者
[type="submit"] {
/* styles */
}
只是好奇!
以下哪个 CSS 选择器更快?
input[type="submit"] {
/* styles */
}
或者
[type="submit"] {
/* styles */
}
只是好奇!
I would say that the latter is faster, simply because it's less information to parse; however, I would think that with each instance, given the speed of servers and clients, you are talking a matter of nano-seconds at best. I think there are a larger number of issues to be concerned about when it comes to processing speeds like redundant code, use of white space and the like.