纯css 设置隔行样式 奇数行: .messageitem:nth-child(even){ color: #c18e14; } 偶数行: .messageitem:nth-child(odd){ color: #84c084; }