Rendering a nested list as a tree

How do I make a vertical border at this stop on the last element?

It can only be a CSS3 / modern browser. But you need to work on different background levels (that is, be transparent).

http://jsfiddle.net/ShgD6/

From this:

Unwanted list

For this:

Wanted list

+5
source share
2 answers

I solved this with css modifications in this fiddle:

http://jsfiddle.net/YYdwc/2/

+6
source

You can select the last element of the list using the CSS pseudo-class :last-childas follows:

ul li:last-child {
    height: 0.7em;
}

0.7em, , , . , , , .

http://jsfiddle.net/wdages/sC5pc/3/

+2

All Articles