这是我的 Fiddle
在这里,我需要将风格应用于价值"测试"这是给定div的第n个孩子。
注意我不应该使用类,因为我使用的是flexigrid。
我该怎么做?
这是我的风格
table, td, th {
border: 1px solid green;
}
th {
background-color: green;
color: white;
}
th:nth-child(2) {
background : red !important;
}
答案 0 :(得分:0)
你的问题确实有点模糊。 但是你不需要一个类来设置这个数据表的样式。
tr:nth-child(2) {
background : red !important;
}
td:nth-child(2) {
background : red !important;
}
th:nth-child(2) {
background : red !important;
}
答案 1 :(得分:0)
你可以试试这个:
table, td, th {
border: 1px solid green;
}
th {
background-color: green;
color: white;
}
th:nth-child(2) div {
background : red;
}