分享几款漂亮的阴影特效

效果1 彩色边框效果

Img 20210617 124334
I

CSS代码如下

div.one div {
    width: 100px;
    height: 100px;
    margin: 50px auto;
    background-color: rgb(245, 234, 234);
    box-shadow:
        10px 0 15px -2px rgb(11, 11, 235),
        0 -10px 15px -2px rgb(103, 167, 8),
        -10px 0 15px -2px rgb(228, 64, 4),
        0 10px 15px -2px rgb(241, 7, 132);
}
div.one div:nth-of-type(1) {
    border-radius: 5%;
}
div.one div:nth-of-type(2) {
    border-radius: 30%;
}
div.one div:nth-of-type(3) {
    border-radius: 50%;
}

效果2 多边框效果

Img 20210617 124319

代码如下

.two div {
    width: 80px;
    height: 80px;
    margin: 50px auto;
    background-color: rgb(238, 226, 226);
    box-shadow: 0 0 0 10px rgb(243, 8, 8), 0 0 0 20px rgb(13, 13, 218), 0 0 0 30px rgb(241, 241, 6), 0 0 0 10px rgb(196, 144, 48) inset, 0 0 10px 20px green inset;
}
.two div:nth-of-type(1) {
    border-radius: 5%;
}
.two div:nth-of-type(2) {
    border-radius: 30%;
    box-shadow: 0 0 0 10px rgb(243, 8, 8), 0 0 0 20px rgb(13, 13, 218), 0 0 0 30px rgb(24, 248, 4), 0 0 0 10px rgb(8, 12, 238) inset, 0 0 10px 20px rgb(6, 236, 167) inset;
}
.two div:nth-of-type(3) {
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgb(3, 233, 41), 0 0 0 20px rgb(13, 13, 218), 0 0 0 30px rgb(219, 6, 226), 0 0 0 10px rgb(97, 231, 8) inset, 0 0 10px 20px rgb(201, 198, 16) inset;
}

效果3 内阴影效果

Img 20210617 124305

代码如下

.three div {
    width: 200px;
    height: 200px;
    overflow: hidden;
    margin: 100px auto;
}
.three div>img {
    height: 200px;
    position: relative;
    z-index: -1;
}
.three div:nth-of-type(1) {
    box-shadow: 0 0 5px 10px rgba(2, 158, 248, 0.5) inset, 0 0 20px rgba(0, 0, 0, .8);
    border-radius: 5%;
}
.three div:nth-of-type(2) {
    box-shadow: 0 0 5px 10px rgba(14, 228, 43, 0.5) inset, 0 0 20px rgba(0, 0, 0, .8);
    border-radius: 30%;
}
.three div:nth-of-type(3) {
    box-shadow: 0 0 5px 10px rgba(245, 7, 146, 0.5) inset, 0 0 20px rgba(0, 0, 0, .8);
    border-radius: 50%;
}
.three div:nth-of-type(4) {
    box-shadow: 0 0 5px 10px rgba(245, 188, 1, 0.5) inset, 0 0 35px rgba(0, 0, 0, .8);
    border-radius: 50%;
}
.three div:nth-of-type(5) {
    box-shadow: 0 0 5px 10px rgba(252, 116, 5, 0.5) inset, 0 0 50px rgba(0, 0, 0, .8);
    border-radius: 50%;
}

效果4 折角效果

Img 20210617 124249

代码如下:

ul.four {
        list-style: none;
        text-align: center;
        font-size: 0;
}
ul.four li {
        display: inline-block;
        margin: 30px;
        width: 480px;
        height: 310px;
        border: 10px white solid;
        box-shadow: 0 0 5px rgba(0, 0, 0, .5);
        position: relative;
        background: white;
}
ul.four li div {
        width: 100%;
        height: 100%;
        overflow: hidden;
}
ul.four li::after,
ul.four li::before,
ul.four li div::after,
ul.four li div::before {
        content: "";
        position: absolute;
        width: 120px;
        height: 40px;
        background: rgb(130, 213, 236);
        box-shadow: 0 4px 3px -3px rgba(0, 0, 0, .3);
}
ul.four li::after {
        right: -60px;
        bottom: -25px;
        transform: rotate(135deg);
}
ul.four li::before {
        right: -60px;
        top: -20px;
        transform: rotate(45deg);
}
ul.four li div::after {
        left: -60px;
        bottom: -25px;
        transform: rotate(-135deg);
}
ul.four li div::before {
        left: -60px;
        top: -20px;
        transform: rotate(-45deg);
}

效果5 外翘边效果

Img 20210617 124227

代码如下:

ul.five {
    list-style: none;
    text-align: center;
    font-size: 0;
    display: flex;
}  
ul.five li {
    display: inline-block;
    margin: 30px;
    width: 500px;
    height: 340px;
    border: 10px white solid;
    box-shadow: 0 0 5px rgba(0, 0, 0, .5);
    position: relative;
    background: white;
}

ul.five li::after,
ul.five li::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 80%;
    bottom: 3%;
    left: 1%;
    right: 1%;
    box-shadow: 0 20px 15px rgba(0, 0, 0, .6);
    transform: skew(0, 5deg);
}

ul.five li::after {
    transform: skew(0, -5deg);
}

ul.five li span {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background:
        linear-gradient(to top right, rgba(0, 0, 0, .5), transparent 15%),
        linear-gradient(to top left, rgba(0, 0, 0, .5), transparent 15%)
}

效果6 内翘边效果

Img 20210617 124135

代码如下:

ul.six {
    list-style: none;
    text-align: center;
    font-size: 0;
}      
ul.six li {
    display: inline-block;
    margin: 30px;
    width: 480px;
    height: 312px;
    border: 10px white solid;
    box-shadow: 0 0 5px rgba(0, 0, 0, .5);
    position: relative;
    background: white;
    border-radius: 0 0 120px 120px / 0 0 30px 30px;            
}
ul.six li::after,
ul.six li::before {
    content: "";
    position: absolute;
    z-index: -2;
    top: 80%;
    bottom: 3%;
    left: .5%;
    right: .5%;
    box-shadow: 0 20px 15px rgba(0, 0, 0, .6);
    transform: skew(0, 5deg);
    border-radius: 40%;
}
ul.six li::after {
    transform: skew(0, -5deg);
}
ul.six li div {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 0 0 120px 120px / 0 0 25px 25px;
    position: relative;
}
ul.six li span {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background:
        linear-gradient(to top right, rgba(0, 0, 0, .5), transparent 15%),
        linear-gradient(to top left, rgba(0, 0, 0, .5), transparent 15%);
}

效果7 曲边特效

image.png

代码如下:

ul.seven {
    list-style: none;
    text-align: center;
    font-size: 0;
}
ul.seven li {
    display: inline-block;
    margin: 30px;
    width: 500px;
    height: 330px;
    border: 10px white solid;
    box-shadow: 0 0 5px rgba(0, 0, 0, .5);
    position: relative;
    background: white;
}
ul.seven li::after {
    content: "";
    position: absolute;
    z-index: -2;
    top: 80%;
    bottom: 0;
    left: 5%;
    right: 5%;
    box-shadow: 0 20px 20px rgba(0, 0, 0, .6);
    border-radius: 50%;
}
THE END
喜欢就支持以下吧
点赞0赞赏
分享
评论 抢沙发

请登录后发表评论