0

Why if I set up background something as "red" like

<table>
    <tr>
        <td bgcolor="red">example</td>
    <tr>
</table>

I get a red cell. But if attribute will be "bgcolor="red;" I get... GREEN cell! Also, it works with blue and blue; , green and green;

What is <color>; in html? Is this documentated?

Tres
  • 186
  • 1
  • 2
  • 11
  • I'd say this is the same as [Why does HTML think “chucknorris” is a color?](https://stackoverflow.com/questions/8318911/why-does-html-think-chucknorris-is-a-color), but I'm not sure if the answer to that addresses the semicolon part. – BoltClock Sep 06 '18 at 14:26
  • 1
    also as a note do not use bgcolor use background-color – Julian Silvestri Sep 06 '18 at 14:31
  • @BoltClock the semicolon is inside the quotes rather than outside. Maybe that's why? – Andrew Fan Sep 06 '18 at 14:32
  • @Andrew Fan: Yeah, I know. It seems that ; just becomes 0 - I forgot that the algorithm just zeroes out all ASCII characters that aren't hex. – BoltClock Sep 06 '18 at 14:33
  • @Julian Silvestri bUgcolor a lot of more funny, I think. – Tres Sep 06 '18 at 14:35

0 Answers0