DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Html

Why does HTML think “chucknorris” is a color?

Share

Why does HTML think “chucknorris” is a color?

Any unknown digit in a HTML color code are treated as  zero so using invalid characters in a color code shows different value.

Missing or incorrect digits are treated as 0 in HTML color code.

For example the values #F0F0F0, F0F0F0, F0F0F, #FnFnFn and FnFnFn are all the same.

Read Also: HTML5 placeholder color with CSS

For example, use “chucknorris“.

Then replace all non valid hexadecimal characters with 0’s i.e. it becomes c00c0000000.

After that, padding out to the next total number of characters divisible by 3 it becomes c00c 0000 0000.

Then, split into three equal groups i.e.
RGB (c00c, 0000, 0000)

Finally, truncate each of the arguments from the right down to 2 characters i.e.
RGB (c0, 00, 00) = #C00000 i.e. RGB(192, 0, 0)

You can see the example with chucknorris :

<table>
<tr>
<td bgcolor="chucknorris" width="25%">chucknorris</td>
<td bgcolor="crap" width="25%">crap</td>
<td bgcolor="pass" width="25%">pass</td>
<td bgcolor="best" width="25%">best</td>
</tr>
</table>

The result will be:

chucknorris crap pass best
Namaste UI

For any types of queries, you can contact us on info[at]namasteui.com.

Published by
Namaste UI
Tags: html

Recent Posts

How Small Brands Can Make Offline Touchpoints Feel More Memorable

Most small brands spend a lot of energy improving digital touchpoints. They refine their websites,…

9 hours ago

What Should You Do When a Dog Bites You?

Not every dog is friendly, and even friendly dogs can attack when threatened or provoked.…

13 hours ago

Holding Manufacturers Accountable: Steps to File a Lawsuit for Pressure Cooker Explosions

Pressure cookers have become a favored kitchen appliance because they can quickly and efficiently cook…

1 day ago

Reasons to Hire a Shopify Web Designer for Your Business

Shopify has quickly become the preferred platform for businesses seeking to build an online presence.…

4 days ago

How To Gain Free Instagram Followers and Likes Easily-GetInsta

We all know that Instagram is a very famous social platform that attracts more and…

1 week ago

How to tell whether high-level glass is toughened or laminated

Glass at height is easy to overlook, in both senses. It is out of reach,…

2 weeks ago