Saber2pr's Blog


In the following structure, a split line is inserted between the li elements:


You can first use the: nth-child () selector to select the tail part, and then add a:: before element to each li in the tail to set the pseudo element to border-bottom to achieve the splitter line. The code is as follows:

li:nth-child(n + 2)::before {
  content: " ";
  display: block;
  border-bottom: 1px solid black;

Nth-child selector