etterwin Asked:2020-07-03 15:17:01 +0000 UTC2020-07-03 15:17:01 +0000 UTC 2020-07-03 15:17:01 +0000 UTC 如何制作装饰元素(见图) 772 告诉我如何实现白色虚线布局并在折叠处制作带有数字的圆圈?它不一定是图像。文本将插入到弯曲之间。 html 1 个回答 Voted Best Answer kizoso 2020-07-14T22:11:57Z2020-07-14T22:11:57Z html, body { position: relative; background-color: #308a56; color: #fff; font-size: 20px; line-height: 20px; } .item { position: relative; padding: 3rem; text-align: center; } .item+.item { margin-top: -2px; } .item:after { content: ''; position: absolute; display: block; bottom: -2px; border-bottom: 2px dashed #fff; left: 6.6rem; right: 6.6rem; } .item__text { height: 1rem } .item__num { position: absolute; border: 2px solid #fff; line-height: 3rem; font-size: 1rem; top: 2rem; height: 3rem; width: 3rem; border-radius: 3rem; background-color: #308a56; z-index: 2; } .item_left .item__num { left: 1rem } .item_right .item__num { right: 1rem } .item_center .item__num { right: 0; left: 0; margin: auto; } .item__num:after { content: ''; position: absolute; display: block; bottom: -2rem; border-bottom: 2px dashed #fff; height: 2rem; width: 4rem; z-index: 1 } .item_left .item__num:after { left: 50%; border-left: 2px dashed #fff; border-radius: 100% / 0 0 0 3rem; } .item_right .item__num:after { right: 50%; border-right: 2px dashed #fff; border-radius: 100% / 0 0 3rem 0; } .item__num:before { content: ''; position: absolute; display: block; top: -2rem; border-top: 2px dashed #fff; height: 2rem; width: 4rem; z-index: 1; } .item_left .item__num:before, .item_center .item__num:before { left: 50%; border-left: 2px dashed #fff; border-radius: 100% / 3rem 0 0 0; } .item_right .item__num:before { right: 50%; border-right: 2px dashed #fff; border-radius: 100% / 0 3rem 0 0; } .items .item:first-child .item__num:before, .items .item:last-child .item__num:after, .items .item:last-child:after { display: none; } .item.item_before-center:after { left: calc(4rem + 50%) } <div class="items"> <div class="item item_left"> <div class="item__num">1</div> <div class="item__text">text</div> </div> <div class="item item_right"> <div class="item__num">2</div> <div class="item__text">text</div> </div> <div class="item item_left"> <div class="item__num">3</div> <div class="item__text">text</div> </div> <div class="item item_before-center item_right"> <div class="item__num">4</div> <div class="item__text">text</div> </div> <div class="item item_center"> <div class="item__num">⌄</div> </div> </div>
1 个回答