css - 翘边阴影效果

<ul>
    <li><img src="images/01.jpg"/></li>
    <li><img src="images/01.jpg"/></li>
</ul>

css:
    li {
        position: relative;
        float: left;
        width: 500px;
        margin-right: 30px;
        background: #fff;
        border-radius: 10px;
    }
    li:before {
        content: '';
        position: absolute;
        left: 27px;
        bottom: 21px;
        z-index: -1;
        width: 90%;
        height: 80%;
        background: #fff;
        box-shadow: 0 8px 30px 5px rgba(0,0,0,.6); //5px颜色加深
        transform: skew(-10deg,-5deg);  // 菱形
    }
    li:after {
        content: '';
        position: absolute;
        right: 27px;
        bottom: 21px;
        z-index: -1;
        width: 90%;
        height: 80%;
        background: #fff;
        box-shadow: 0 8px 30px 5px rgba(0,0,0,.6);
        transform: skew(10deg,5deg);
    }
    li:nth-op-type(2) {
        margin-right: 0;
    }
    img {
        width: 460px;
        height: 276px;
        padding: 20px;
        vertical-align: top;  // 消除图片间的小缝隙
    }

翘边阴影

猜你喜欢

转载自blog.csdn.net/weixin_42675488/article/details/82558934
今日推荐