CSS - Vertical line between bullets in an unordered list

后端 未结 5 1791
无人及你
无人及你 2020-12-05 07:25

How would I go about drawing a vertical line between the bullets in an unordered list, like so:

Notice that the line stops at the last list bullet. I\'m usi

5条回答
  •  悲哀的现实
    2020-12-05 07:53

    You need to add a inner and outter div and then play with margins. Here is what i mean

    DEMO: http://jsfiddle.net/kevinPHPkevin/N9svF/

    ul {
        padding-left:14px;
        margin-top:-6px;
        margin-bottom:-6px;
        padding-bottom:0;
    }
    #mainDiv {
        height: 200px;
        width:200px;
        position: relative;
    }
    #borderLeft {
        border-left: 2px solid #f51c40;
        position: absolute;
        top: 25px;
    }
    

提交回复
热议问题