Set different background colors for odd and even rows (css modification)

1. Effect drawing 

 

 2.Code

/* 奇数行的样式 */
.list:nth-child(odd) > .rows {
  background: #99d0e7;
  width: 100%;
  display: flex;
}
 
/* 偶数行的样式 */
.list:nth-child(even) > .rows {
  background: #899196;
  width: 100%;
  display: flex;
}

Guess you like

Origin blog.csdn.net/m0_68428581/article/details/131770339