July 5, 2000 - Resolving Style Conflicts

Now that Cascaded Style Sheets have
become popular, you need to pay attention to conflicts in style specifications
as it's possible to inadvertently specify conflicting styles to the same element.
Here's an example:

<TABLE BORDER=1>
<TR>
<TD CLASS="kuku" STYLE="background-color:tan">Come back to docjavascript.com for a new tip every day</TD>
<TD CLASS="kuku" BGCOLOR="tan">Come back to docjavascript.com for a new column every two weeks</TD>
</TR>
</TABLE>

which looks like this:

Come back to docjavascript.com for a new tip every day

Come back to docjavascript.com for a new column every two weeks

Notice that the left cell colored tan by the local STYLE specifications. The right cell is colored yellow, because there is only a BGCOLOR specification that does not override the global kuku class definition. We can conclude that particular STYLE definitions override global statements, while element attributes take precedence over global STYLEs.