Pure css tree with borders

后端 未结 4 1235
情歌与酒
情歌与酒 2021-01-06 05:21

I am trying to create a tree with indentations in pure CSS. I have been trying using something like:

ul.tree ul {
  padding-left: 5px;
}

Ho

4条回答
  •  青春惊慌失措
    2021-01-06 05:54

    For lists with unknown depths, I've used an absolutely positioned element for separating lines. It adds a little extra markup, but seems to work.

    div.separator {
        position:absolute;
        left:0px;
        right:0px;
        border-top:1px solid lightgray;
    }
    
    
    

    http://jsfiddle.net/7u87c/20/

提交回复
热议问题