Why “chucknorris” is used as a color in HTML ?

The HTML accepts non hexadecimal character as 0 so we all know that 0-9 define zero to nine then A-F define ten to fifteen. So there are so many words that can be a color like chucknorris as deep blood red color like this.

If you are putting any word at bgcolor that contains a few hexadecimal character then that character will show you some unexpected color that you never imagine. It works like #F00F00 is equal to #FotFot. But this will only work on bgcolor inside the table tag nowhere else.

chucknorris = c00c0000000 in hexadecimal, after that it split that into three equal groups like c00c 0000 0000 and after that it will truncate from the right down to two characters, makes that RGB color (C0, 00, 00) that is same as RGB(198, 0, 0) which is blood red.

Below example illustrates this concept:

Example:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
<head>
    <title>
        Why “chucknorris” is used
        as a color in HTML ?
    </title>
    <style>
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <center>
        <h1>GeeksforGeeks</h1>
        <p>
          Non hexadecimal character behave like 0
        </p>
        <table>
            It is the color of:
            <td bgcolor="chucknorris">
              chucknorris
            </td>
        </table>
    </center>
</body>
  
</html>

chevron_right


Output:

There are so many other colors can be made, if you try to create. The basic rule is words have to contain at least one character in the range of A-F inside of that hexadecimal conversion like grass, crap, chucknorr, khoocnocr, and mrt. You can create by your own, but this is not the correct procedure to choose hexadecimal.

Supported Browsers: The browsers supported by this procedure are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.