This is, somewhat surprisingly, intentional error handling, described in clause 2.4.6 Colors of HTML5 CR. It is presumably meant to maintain compatibility with legacy content that has weirdly broken color designators that have been traditionally processed in a certain manner by browsers.
When the mixed-syntax (partly HTML, partly XHTML) markup <hr width=100% color=red/>
is used, in a document served as text/html (when served with an XHTML content type, it would simply cause nothing but an error message to be shown), the color
attribute will be parsed as red/
(with the slash as part of the value). Since this does not match any color name, rules for parsing a legacy color value will be applied.
This means that any character that is not a hexadecimal digit is replaced by the digit 0, and if the resulting value is not six characters long, trailing zeroes will be added. Finally, the value is prefixed with #
, so it will be interpreted as a hexadecimal color designator. Thus, red/
yields #0ed000
, which is the light green color that you see.
Similarly, <hr width=100% color=blue/>
would cause the color #b00e00
to be used.
The problem can of course be avoided by using either HTML syntax (which has no /
before >
) or XHTML syntax (which has quotation marks around each attribute value).