Vol*_*il3 4 css css-selectors css-tables
我正在使用通用规则TH标记,Table但它扰乱了所有事情.我使用的规则如下:
th
{
color: #fff;
background: #7d7e7d;
}
Run Code Online (Sandbox Code Playgroud)
但现在我想为几个表指定ID,以便它根本不影响其他表.我做的是:
#id1,#id2 th
{
color: #fff;
background: #7d7e7d;
}
Run Code Online (Sandbox Code Playgroud)
这种颜色的传播方式也是如此.我如何完成任务?
您需要指定th两个时间,因为逗号分隔整个选择器:
#id1 th, #id2 th
{
color: #fff;
background: #7d7e7d;
}
Run Code Online (Sandbox Code Playgroud)
否则,你会选择整个#id1以及刚刚#id2 th.