Attempting to apply both body color
and table color
simultaneously would be considered invalid in both (x)html and css.
color
determines the text color of an element, while background-color
determines the background color. For example:
body {background-color: #ffa; }
/* sets the background of the `body` element to #ffa (yellow) */
table {background-color: #f90; }
/* sets the background of the `table` element to #f90 (orange) */
It is not recommended to use these colors together, but they provide clear visibility and indicate whether they are being applied or not.
In css, most properties cascade down, but some do not. The values set for a table {/* css */}
element will override those of a parent or ancestor element, as long as the new values are explicitly stated.
Although there is a CSS3 not()
selector available (which I previously thought was only a jQuery implementation), it is currently only supported in 'modern' browsers and may not be widely useful at this time. Furthermore, it may not necessarily solve your specific situation.