CSS: Which is faster for the browser? color:#fff; or color:#ffffff;

后端 未结 2 833
面向向阳花
面向向阳花 2021-01-29 10:10

First things first, yes I know the render the same color, my question is is a simple query about speed.

This is just a topic of interest regarding optimising page load s

2条回答
  •  不知归路
    2021-01-29 10:26

    #fff is fewer characters, which is generally better. Network latency and bandwidth matter more than processing time in most cases. For this reason, most CSS compressors will intelligently optimize to the #fff version. The network matters more than parsing speed in this case.

    If you're concerned about parsing time, I doubt the difference between the 2 declarations accounts for even 0.005% of total parsing time. There are much bigger bottlenecks that dwarf any speed difference compared to parsing color declarations.

提交回复
热议问题