我的表有id =“mytable”。我试图在第一个和最后一个< th>应用一些CSS只要。我试过这个,但它不行。
#mytable th:first,#mytable th:last{ //css goes here }
解决方法
#mytable th:last-child,#mytable th:first-child { //css goes here }
#mytable th:first,#mytable th:last{ //css goes here }
#mytable th:last-child,#mytable th:first-child { //css goes here }