gpt4 book ai didi

html - HTML 中表属性的 CSS

转载 作者:行者123 更新时间:2023-11-28 04:57:03 25 4
gpt4 key购买 nike

在单个页面中我有多个表,但只针对一组表,而不是对所有表应用 css。用于table bgcolorth colorborder colortext color。所以我尝试创建一个单独的类.mytable 并应用它不起作用,但如果我将 .mytable 设为 table 它适用于所有表格。请帮我解决这个问题。提前致谢。

jsFiddle Link is Here

<style>
.mytable td th //instead of .mytable table it works
{
border:1px solid green;
}
th{
background-color:green;
color:white;
}
</style>



<table class="mytable">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Savings</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
<td>$100</td>
</tr>

</table>
<table> /// no need of this css
</table>

最佳答案

重写这个 .mytable td th.mytable td, .mytable th

此处:http://jsfiddle.net/y8B2j/1/

关于html - HTML 中表属性的 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21013739/

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