gpt4 book ai didi

HTML 表 CSS?

转载 作者:太空宇宙 更新时间:2023-11-04 00:06:33 25 4
gpt4 key购买 nike

常见

table tr td
{
vertical-align:middle;
}

自定义

table.custom tr td
{
vertical-align:top;
}

当我这样使用时:

<table class="custom">
<tr>
<td>
<table>
<tr>
<td>this text align top, but I want to align middle
</td>
</tr>
</table>
</td>
</tr>
</table>

子表的行为与其父表相同。怎么能忽略父元素样式呢?

最佳答案

您可以做的一件事是像这样添加子选择器:

table.custom > tr > td { }

那么只有直接的 child 会匹配样式

关于HTML 表 CSS?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14672138/

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