Click to See Complete Forum and Search --> : dont understand this CSS


cofactor
01-09-2006, 12:53 AM
<title>tables</title>
<style type="text/css">
#playlist tbody tr.even td {
background-color: #eee;
}
#playlist tbody tr.odd td {
background-color: #fff;
}
</style>


dont understand the meaning of this CSS.....

this CSS is used like this


<table id="playlist">
<tbody>
<tr class="odd">
<!-- cells go here -->
</tr>
<tr class="even">
<!-- cells go here -->
</tr>


what does it mean when we define a CSS like this
#playlist tbody tr.even td ? its quite peculiar syntax.

i saw w3school's tutorial http://www.w3schools.com/css/css_syntax.asp

but the above syntax does not match with them....

will you please tell whats the meaning of this syntax #playlist tbody tr.even td ?

thank you

cofactor
01-09-2006, 01:11 AM
in this syntax "#playlist tbody tr.even td"

whats the meaning of tr.even .....this is not a valid HTML tag !!!....tr,tbody,td etc are valid html tags but tr.even is not a valid html tags !!!

NogDog
01-09-2006, 01:30 AM
the tr.even means a TR tag of class "even", e.g.: <tr class="even">. So the entire selector means any TD tag within a TR tag of class "even" within a TBODY tag that is within any element with an ID of "playlist" (for example <table id="playlist">).

cofactor
01-09-2006, 02:00 AM
perfect.

thank you.