Is there any technical benefit to using 6 digit HTML color codes when 3 digits are enough?

Possible duplicate:
Using 3-digit color codes instead of 6-digit color codes in CSS

I was browsing the CSS of the new YouTube website . There are many examples of using six-digit hexadecimal color codes when 3 is enough, for example:

  • color:#990000
  • color:#550000
  • color:#000000
  • color:#005500

In this case, I always prefer 3 characters. Perhaps YouTube feels this makes it clearer and reduces it to 3 characters, not worth the minimum savings. This is normal. I'm just wondering if there are any additional technical benefits to using 6 characters - for example, the lack of 3 character compatibility with some older browsers. Any idea?

+4
source share
2 answers

There is no significant difference.

Yes, they can shave a few bytes from their network payload by reducing #990000 to #900 , and I admit I'm surprised that their CSS minifier did not.

Then, if they send it over the network using compression (which they probably have), then compression will take full care of these three bytes.

Consequently, no significant difference.

+4
source

Strictly speaking, there is actually a small technical penalty , as you send 3 extra characters over the network ...

0
source

Source: https://habr.com/ru/post/1384504/


All Articles