表中的CSS问题,样式没有完全显示

时间:2016-11-08 10:59:37

标签: html css

得到了样式的css表但由于某种原因行样式被切断,css检查器显示任何明显的错误。附件是css和表

enter image description here 问题的例子     see codepen

1 个答案:

答案 0 :(得分:3)

background上使用td代替tr将解决您的问题。

table.striped tr:nth-child(even) td {
    background-color: #fff;
}
table.striped tr:nth-child(odd) td{
    background-color: #efefef;
}

<强> Updated Codepen