Append horizontal rule to each
  • 前端 未结 6 1649
    陌清茗
    陌清茗 2021-01-03 20:03

    For my

      list, I would like to add a
      after each element of a list. The Result should render like:

    6条回答
    •  刺人心
      刺人心 (楼主)
      2021-01-03 20:28

      I think it's better to use CSS for this. for example you can stop using


      tag, instead do something like:

      • moooo!
      • maaaaa!
      • ...

      and then with CSS:

      .mylist li { border-bottom: 1px solid black; }
      

      There are other options too, for example if you want to show the horizontal line only for some list items, you can give them a class and add a CSS rule only for that class. like this:

      • moooo!
      • maaaaa!
      • ...

      and CSS:

      .mylist li.hr { border-bottom: 1px solid black; }
      

    提交回复
    热议问题