I was creating a simple testpage for myself, in which I’ve encountered a surprising bug. Firefox and chrome fail to correctly parse “rgb” coloring attribute. I know using “bg_color” is deprecated and I know it’s always better to use “#code” but now I’m wondering what’s causing this problem. I’ve also checked and apparently IE doesn’t have such a bug. or maybe I’m doing something wrong? this code will result in dark blue bg color in chrome and FF.
<html>
<body>
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td bgcolor="#FF0000">January</td>
<td bgcolor="rgb(0,255,0)">$100</td>
</tr>
</table>
</body>
sidenote: browsers should support rgb as written in w3school
HTML attributes are not the same thing as CSS. The rgb() notation is CSS-only, and doesn’t work in
bgcolororcolorattributes.You can use CSS in an attribute, however – specifically the
styleattribute, if you don’t want to generate stylesheets: