用伪类的方式给div加分割线,确保每个div宽度相同

     div1:not(:last-child) ::after {
                content: '';
                display: block;
                width: 1px;
                height: 24px;
                background-color: rgb(224, 224, 224);
                position: absolute;
                right: -12px;
            }

  

            &::before {
                content: '';
                display: block;
                width: 1px;
                height: 24px;
                background-color: rgb(224, 224, 224);
                position: absolute;
                left: -12px;
            }
            &:first-child {
                &::before {
                    display: none;
                }
            }

  

 

posted on 2023-08-30 16:13  稳住别慌  阅读(113)  评论(0)    收藏  举报