which one is faster: hex color codes or color names?

后端 未结 3 1615
灰色年华
灰色年华 2020-12-11 15:28

I just wanted to know if it\'s faster to use hex color codes or the color names when I want to use it in CSS?

3条回答
  •  借酒劲吻你
    2020-12-11 16:16

    Faster in terms of rendering?

    In practical terms, there's no possible way it will ever make any difference.

    In technical terms, that depends on how the CSS rendering is implemented in each browser. If I had to make a guess, I'd imagine that using hex is about 3 CPU cycles (an exaggeration) faster in most browsers, since the name has to be converted to hex first.

    But the time it took you to ask the question represents more time than has been wasted by all browsers in the world doing this conversion since the Internet was invented.

提交回复
热议问题