this might be elementary to some of you, but I would appreciate some help with understanding it...I have this code for an "odd" table row background color. the "even" table row background has a different color that is actually the color set to the table. here is the code for the odd:
...it makes all the <td>'s display the <table> background color....but the fist tag in the row (the <th> tag) is set to the #EFEFEF color.
any ideas why it's doing this? this isn't so much of a "i can't get this to work" problem, because i've already found a solution for it. this is more of a "what makes this happen?" kind of thing. so what makes it happen?
There's a simple answer to your question - "tbody tr.odd th td" should read "tbody tr.odd th" (that is, remove the last "td"). The TH tag is used instead of the TD tag, and not with it, so your CSS would actually be referencing all TDs which are inside THs, which is illegal according to the spec.
Also, make sure that you actually mean "tr.odd" rather than "tr", otherwise this rule will only apply to code such as [td class="odd"][th] etc.
ah yes....that helps alot. i'm a bit new to this and i didn't quite understand that when you write elements down like that they are actually inheriting. that code was actually some free CSS and i was editing it for myself.
Glad to see it helped. When you write elements after each other, it means that each element is contained within the previous one. If you want to write rules which apply to more than one element, then you can separate them using commas...