gpt4 book ai didi

html - 尝试使用 first-child 伪类选择器

转载 作者:太空宇宙 更新时间:2023-11-03 21:00:13 24 4
gpt4 key购买 nike

我有以下不适合我的 CSS。

table.fields tr > td:first-child { padding-right: 50px; }

HTML就像下面这样:

    <table class="fields">
<tbody>
<tr>
<td> text... </td>
<td> another td elem... </td>
</tr>
</tbody>
</table>

我想将填充应用于第一个 <td>元素而不是第二个。

最佳答案

这是在 stevebot 解决问题之前发布的。为了发表评论而将我的帖子留在这里。


您的表没有字段 类。将其更改为此,您的 CSS 选择器应该会选择它。

<table class="fields">

关于html - 尝试使用 first-child 伪类选择器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4522318/

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