Why does CSS think Chuck Norris is a color?
Because “Chuck Norris” can be converted to a hexadecimal number.
Here are the CSS rules to parse random strings as hex triples:
- Make the string a length that is a multiple of 3 by adding 0s: chucknorris0
- Separate the string into 3 equal length strings: chuc knor ris0
- Truncate each string to 2 characters: ch kn ri
- Keep the valid Hex digits, and add 0’s where necessary: C0 00 00
/* What color are these? What color is your name in Hex? */ p#one {background-color: "ChuckNorris";} p#two {background-color: "LadyGaGa";} p#three {background-color: "GangnamStyle";}