Creating CSS3 Circles connected by lines

前端 未结 8 1316
一个人的身影
一个人的身影 2020-12-02 05:19

I have to implement the following circle and line combination in CSS and I am looking for pointers on how to implement this effectively. The circles and lines should look li

8条回答
  •  不思量自难忘°
    2020-12-02 05:37

    Example I made based on the answer: https://codepen.io/Smakosh/pen/ZvvyMg

    Pug
    ul
      li.list.active 1
      li.list 2
      li.list 3
      li.list 4
    Sass
    ul
      list-style: none
        li
          display: inline-block
          width: 4rem
          height: 4rem
          line-height: 4rem
          border-radius: 100%
          background: #d8d8d8
          margin-right: 2rem
          position: relative
          &:first-child
            margin-left: unset
            &:before
              display: none
          &:before
            content: ''
            width: 2.4rem
            background-color: #d8d8d8
            height: 2px
            position: absolute
            top: 2rem
            right: 3.9rem
        .active
          background: #03A9F4
          color: #fff
          &:before
            background-color: #03A9F4
    

提交回复
热议问题