Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

style explanation 1

Status
Not open for further replies.

TFfan

Programmer
Jan 18, 2002
192
CA
table.spanning td.spanning {color: #efefef; font-family: Arial; font-weight: bold; font-size: 14px; : 2;}

I don't completely understand this. I keep my css simpler (no doubt inferior). Does this mean that when table.spanning AND td.spanning are used, do this? So if I were just using table.spanning, I could use a different style? Also, what does the ': 2' signify?

Thanks.
 
Using space in style declarations means descendant. Your declaration thus states:

table.spanning td.spanning: This applies to table cell (<td>) with a class name spanning (<td class="spanning">) that is within a table with a class name spanning (<table class="spanning">).

Example:
Code:
<table class="spanning">
 <tr>
  <td>This cell does not have the described style</td>
 </tr>
 <tr>
  <td class="spanning">This cell has the described style</td>
 </tr>
</table>

<table>
 <tr>
  <td>This cell does not have the described style</td>
 </tr>
 <tr>
  <td class="spanning">This cell again does not have the described style</td>
 </tr>
</table>
I hope it makes sense. I have no idea what :2 means, I personally would say it's a mistake.
 
Very nicely, explained. Thanks so much for your time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top