加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

html – 需要使用CSS选择器选择第二个表的第二行

发布时间:2020-12-14 23:47:43 所属栏目:资源 来源:网络整理
导读:我有一个 HTML表格如下: table class="reference notranslate" tr../tr . . tr../tr/tabletable class="reference notranslate" tr../tr . . tr../tr/tabletable class="reference notranslate" tr../tr . . tr../tr/table 我知道XPATH://表[@class =’ref
我有一个 HTML表格如下:
<table class="reference notranslate">
  <tr>..</tr>
     .
     .
  <tr>..</tr>
</table>
<table class="reference notranslate">
  <tr>..</tr>
     .
     .
  <tr>..</tr>
</table>
<table class="reference notranslate">
  <tr>..</tr>
     .
     .
  <tr>..</tr>
</table>

我知道XPATH://表[@class =’reference notranslate’] [2] / tr [2]

我想选择第二个表的第二行.任何人都可以帮助如何编写CSS选择器吗?

解决方法

“I know the XPATH : //table[@class = 'reference notranslate'][2]/tr[2]

I want to select second table’s second row. Can any one help how to
write the CSS selectors from the same?”

所以,你的意思是:

table.reference.notranslate:nth-child(2) tr:nth-child(2)

这将选择第二个表的第二个后代tr元素,它具有两个类(引用和非转换).

jsFiddle here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读