What is the specificity of the following selector : table tr:first-child>span.class>a?
Asked
Active
Viewed 355 times
-1
-
2What do you mean _what is the specificity_? That is the specificity .... do you mean how specific is amoungst all your other selectors? We would need to know what you are comparing it to. – zgood Jan 31 '18 at 17:45
-
2https://specificity.keegan.st/ – j08691 Jan 31 '18 at 18:02
2 Answers
2
Any [a
] that is a child of any [span
with the class class
], which in turn is a child of a [tr
that is the first child of its parent] that is a descendant of a [table
].
It will target the only link in the example:
<table>
<tr>
<th>Countries</th>
<th>Capitals</th>
<th>Population</th>
<th><span class="class"><a href="#">Language</a></span></th>
</tr>
<tr>
<td>USA</td>
<td>Washington D.C.</td>
<td>309 million</td>
<td>English</td>
</tr>
<tr>
<td>Sweden</td>
<td>Stockholm</td>
<td>9 million</td>
<td>Swedish</td>
</tr>
</table>

VorganHaze
- 1,887
- 1
- 12
- 35
1
There literally dozens of calculators online you could search for which will compute it for you: https://specificity.keegan.st/
Just copy and paste in your selector. It's 0,0,2,4
.

skyline3000
- 7,639
- 2
- 24
- 33