Pure css tree with borders

后端 未结 4 1126
情歌与酒
情歌与酒 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:41

    This CSS makes the link inside a nested li have a padding-left of 30px, and I add another nested li link have padding-left: 60px.

    ul.tree li ul li a {
        padding-left: 30px;
    }
    
    ul.tree li ul li ul li a {
        padding-left: 60px;
    }
    

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

提交回复
热议问题