CSS warped shadow implementation code

CSS warped shadow implementation code

This article introduces the implementation code of CSS warped shadow and shares it with everyone. The details are as follows:

If you look closely, you can see that the two corners at the bottom of each picture have varying degrees of warping.

The implementation principle is similar to [CSS] curve shadow, and is also achieved through pseudo-elements.

HTML Code

<ul class="box">
    <li><img src="......" alt=""></li>
    <li><img src="......" alt=""></li>
    <li><img src="......" alt=""></li>
</ul>

CSS Code

ul,li {
    list-style:none;
}
.box {
    width: 980px;
    height: auto;
    clear: both;
    overflow: hidden;
    margin: 20px auto;
}
.box li {
    width: 300px;
    height: 210px;
    position: relative;
    background: #fff;
    float: left;
    margin: 20px 10px;
    border: 2px solid #efefef;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .27), 0 0 60px rgba(0, 0, 0, 0.1) inset;
}
.box li img {
    display: block;
    width: 290px;
    height: 200px;
    margin: 5px;
}
.box li:before, .box li:after {
    content: '';
    position: absolute;
    z-index: -2;
    width: 80%;
    height: 80%;
    bottom: 8px;
    background: transparent;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.6);
}
.box li:before {
    left: 7%;
    transform: skewX(-12deg) rotate(-4deg);
}
.box li:after {
    right: 7%;
    transform: skewX(12deg) rotate(4deg);
}

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

<<:  MySQL primary key naming strategy related

>>:  HTML Tutorial: Collection of commonly used HTML tags (5)

Recommend

Mysql transaction concurrency problem solution

I encountered such a problem during development A...

Explore JavaScript prototype data sharing and method sharing implementation

Data Sharing What kind of data needs to be writte...

Detailed explanation of the implementation of shared modules in Angular projects

Table of contents 1. Shared CommonModule 2. Share...

Linux kernel device driver Linux kernel basic notes summary

1. Linux kernel driver module mechanism Static lo...

Automated front-end deployment based on Docker, Nginx and Jenkins

Table of contents Preliminary preparation Deploym...

js uses cookies to remember user page operations

Preface During the development process, we someti...

jQuery achieves the shutter effect (using li positioning)

This article shares the specific code of jQuery t...

JavaScript Factory Pattern Explained

Table of contents Simple Factory Factory Method S...

Listen directive example analysis in nginx

Plot Review In the previous article, we analyzed ...