Simulating border-collapse in lists (no tables)

前端 未结 7 1184
星月不相逢
星月不相逢 2020-12-08 19:09

I have always the same problem, when I have 2 adjacent elements with borders, the borders are merged. With tables we have the border-collapse property for solving this.

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 19:47

    Give the elements margins. For example,

    HTML:

    • Stuff
    • Other Stuff

    CSS:

    li { border: 1px solid #000; margin: 5px 0; }
    

    jsfiddle example

提交回复
热议问题