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

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

Why does HTML think "chucknorris" is a color?

Why do certain random strings produce colors when entered as background colors in HTML?

For example, bgcolor="chucknorris" produces a red background:

<body bgcolor="chucknorris"> test </body>

Conversely, bgcolor="chucknorr" produces a yellow background:

<body bgcolor="chucknorr"> test </body>

This holds true across various browsers and platforms. What’s going on here?

Answer*

Draft saved
Draft discarded
Cancel
2
  • The first link is (effectively) broken. There doesn't seem to be a section with a headline of "Rules for parsing a legacy colour value" (or similar). Though there is a similar page anchor, "legacy-extract-an-encoding" Commented Nov 30, 2022 at 22:23
  • This is probably the correct link: html.spec.whatwg.org/multipage/… Commented Apr 27, 2023 at 6:48

lang-html

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