1

以下哪个 CSS 选择器更快?

input[type="submit"] {
    /* styles */
}

或者

[type="submit"] {
    /* styles */
}

只是好奇!

4

1 回答 1

1

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.

于 2012-04-27T06:33:50.600 回答