Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

6 of 10
added 2 characters in body
Alireza
  • 105.5k
  • 27
  • 280
  • 173

The reason is the browser can not understand it and try to somehow translate it to what it can understand and in this case into a hexadecimal value!

chucknorris starts with c which is recognised character in hexadecimal, also it's converting all unrecognised characters into 0!

So chucknorris in hexadecimal format becomes: c00c00000000, all other characters become 0 and c remains where they are...

Now they get divided by 3 for RGB(red, green, blue)... R: c00c, G: 0000, B:0000...

But we know valid hexadecimal for RGB is just 2 characters, means R: c0, G: 00, B:00

So the real result is:

bgcolor="#c00000";

I also added the steps in the image as a quick reference:

Why does HTML think "chucknorris" is a color?

Alireza
  • 105.5k
  • 27
  • 280
  • 173

AltStyle によって変換されたページ (->オリジナル) /