CSS skills: pure CSS single label to achieve fork graphics

key point

  • Use the feature of multiple shadows to complete the head part of the fork.
    Insert picture description here
<div></div>

scss

div {
    
    
    position: relative;
    width: 140px;
    height: 140px;
    margin: auto;
    border-radius: 50%;
    background: #fff;
    
    &::before {
    
    
        content: "";
        position: absolute;
        width: 40px;
        height: 200px;
        left: 50%;
        top: 100%;
        background: #fff;
        border-radius: 20px;
        transform: translate(-50%, -50%);
    }
    
    &::after {
    
    
        content: "";
        position: absolute;
        width: 20px;
        border-radius: 15px;
        height: 100px;
        background: #fff;
        left: 0;
        top: -20px;
        box-shadow: 20px 0 0 0 #000,
            40px 0 0 0 #fff,
            60px 0 0 0 #000,
            80px 0 0 0 #fff,
            100px 0 0 0 #000,
            120px 0 0 0 #fff;
    }
}

Guess you like

Origin blog.csdn.net/m0_47883103/article/details/108629192
Recommended