gpt4 book ai didi

具有特定 TD 的表格的 CSS 选择器

转载 作者:行者123 更新时间:2023-12-04 05:28:55 24 4
gpt4 key购买 nike

我有两张同类的 table

<table class='pp' >
<tr class='pp'>
<td class='pppagetitle'>A Table</td>
</tr>
</table>
<table class='pp' >
<tr class='pp'>
<td class='ppinstance'>Another Table</td>
</tr>
</table>

但只想选择带有 td 类 pppagetitle (!) 的那个 - 有什么指示吗?

最佳答案

.pp:nth-child(1){background:green;}

但这并没有得到很好的支持(不适用于 IE8 及以下)

或者将表放在容器中并使用
:first-child

Example:

<style>
.container > .pp:first-child{background:green;}
</style>
<div class="container">
<table class="pp"></table>
<table class="pp"></table>
</div>

更多文档: Quirksmode.org

关于具有特定 TD 的表格的 CSS 选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12875106/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com