기본 아이디어는 다음과 같습니다.
ul 또는 li 태그 아래에 세 개의 li 목록을 만듭니다.
li 태그 위치를 상대적으로 설정합니다. 그리고 왼쪽 패딩을 줍니다
li { height: 40px; padding-left: 20px; display: flex; align-items: center; position: relative; }
li::before CSS 속성을 사용하고 주위에 왼쪽 테두리를 만듭니다.
li::before { content: ''; position: absolute; left: -16px; border-left: 2px solid black; height: 100%; width: 1px; }
이제 li::after CSS 속성을 사용하고 그 주위에 세 개의 원을 만듭니다.
li::after { content: ''; display: inline-block; height: 10px; width: 10px; border-radius: 50%; background-color: blue; margin-left: -80px; }
이제 마지막으로 첫 번째 목록과 마지막 목록에서 줄을 자릅니다.
li:first-child:before { top: 20px; } li:last-child:before { top: -20px; }
및 결과:
전체 코드:
html:
css:
li { height: 40px; padding-left: 20px; display: flex; align-items: center; position: relative; } li::before { content: ''; position: absolute; left: -16px; border-left: 2px solid black; height: 100%; width: 1px; } li::after { content: ''; display: inline-block; height: 10px; width: 10px; border-radius: 50%; background-color: blue; margin-left: -80px; } li:first-child:before { top: 20px; } li:last-child:before { top: -20px; }
부인 성명: 제공된 모든 리소스는 부분적으로 인터넷에서 가져온 것입니다. 귀하의 저작권이나 기타 권리 및 이익이 침해된 경우 자세한 이유를 설명하고 저작권 또는 권리 및 이익에 대한 증거를 제공한 후 이메일([email protected])로 보내주십시오. 최대한 빨리 처리해 드리겠습니다.
Copyright© 2022 湘ICP备2022001581号-3