Gur*_*ngh 15 html javascript css tree
本教程的结尾显示分支中的最后一个节点后面没有任何垂直条.但我无法让它以这种方式运作!如果我做错了什么想法,或者教程遗漏了什么!
我甚至尝试过:last-child伪类,如教程中所示,但得到了相同的结果.

nic*_*ass 20
这是尝试仅使用伪元素和边框:
ul, li{
position: relative;
}
/* chop off overflowing lines */
ul{
overflow: hidden;
}
li::before, li::after{
content: '';
position: absolute;
left: 0;
}
/* horizontal line on inner list items */
li::before{
border-top: 1px solid #333;
top: 10px;
width: 10px;
height: 0;
}
/* vertical line on list items */
li::after{
border-left: 1px solid #333;
height: 100%;
width: 0px;
top: -10px;
}
/* lower line on list items from the first level
because they don't have parents */
.tree > li::after{
top: 10px;
}
/* hide line from the last of the first level list items */
.tree > li:last-child::after{
display:none;
}
Run Code Online (Sandbox Code Playgroud)
演示(编辑)
| 归档时间: |
|
| 查看次数: |
17374 次 |
| 最近记录: |