Performance: Pure CSS vs jQuery

前端 未结 3 1169
名媛妹妹
名媛妹妹 2020-12-08 05:01

I\'ve seen a number of code comparisons between pure CSS and the equivalent jQuery. But I\'m looking for details about why pure CSS is definitively faster than jQuery.

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 05:26

    I think the main reason CSS is faster is because it can be optimized more than javascript because it is less complicated, the code is just a series of rules and doesn't have much of its own logic (other than selectors and the occasional calc() function) BTW, CSS definitely does have to be evaluated by the browser.

提交回复
热议问题