td:nth-child(3){background-color:#000; color:#fff;}/*把第3个td的背景设为黑色*/

p标签页是可以的,规定属于其父元素的第二个子元素的每个 p 的背景色:

p:nth-child(2)
{
background:#ff0000;
}

 

相关文章:

  • 2020-02-24
  • 2021-11-13
  • 2022-12-23
  • 2021-10-23
  • 2022-03-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 1970-01-01
  • 2021-12-31
  • 2021-12-09
  • 2021-12-31
  • 2021-06-14
  • 2022-12-23
相关资源
相似解决方案