DEV Community

How to Create Joined Bulletpoint Lists with CSS, BBC News-style

Peter Cooper on May 07, 2019

When there are live events, BBC News often runs a 'timeline' style list against stories. For example: I was intrigued to work out how they'd got...
Collapse
 
fam_arg profile image
Familias Argentinas

Very nice.
Question: how can y make this line conections?
Notice that the connextion is onli betweeb 1st and 2nd dots (#). (each sub

  • has only 2 dots) (it is for a family tree chart). THANK YOU !!!

    1 .........

    | #1.......
    | | #1......
    | | | #1.....
    | | | |
    | | | #2.....
    | | #2......
    | | #1.....
    | | |
    | | #2.....
    | #2......
    | #1......
    | | #1....
    | | |
    | | #2.....
    | #2......
    | #1.....
    | |
    | #2.....

    2.........

       #1......
       |    #1.....
       |    |     #1.....
       |    |     |
       |    |     #2.....
       |    #2.....
       |         #1.....
       |         |
       |         #2.....
       #2......   
            #1.....
            |     #1.....
            |     |
            |     #2..... 
            #2.....
                 #1.....
                 |
                 #2.....
    

    Notice that the connextion is onli betweeb 1st and 2nd dots. (each sub

  • has only 2 dots)
  • Collapse
     
    adamhite profile image
    Adam Hite

    One thing to keep in mind is that if you set a list (ordered or unordered) to list-style: none in webkit, it removes the list element semantics, which is bad for accessibility. There is a fix for this posted by Scott O'Hara here: scottohara.me/blog/2019/01/12/list...

    Collapse
     
    amyblankenship profile image
    AmyBlankenship

    You could also use a :before on the ul as a whole, and then you could use margins if you want. The tricky part would be stopping the line at the right place. One way to handle that would be a before: on the final li with a background color that covers it up.

    Collapse
     
    mugas profile image
    Ricardo Moreira

    Nice example

    Collapse
     
    vizca75 profile image
    Jesús Antonio Vizcaíno Jiménez

    Lovely! It's great for resume sites if you want enumerate jobs or skills… shared on Twitter