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

The implementation principle of Mysql master-slave synchronization

1. What is MySQL master-slave synchronization? Wh...

One line of code teaches you how to hide Linux processes

Friends always ask me how to hide Linux processes...

This article teaches you how to play with CSS border

Border Style The border-style property specifies ...

Javascript Virtual DOM Detailed Explanation

Table of contents What is virtual dom? Why do we ...

Implementation of nacos1.3.0 built with docker

1. Resume nacos database Database name nacos_conf...

Detailed explanation of MySQL partition table

Preface: Partitioning is a table design pattern. ...

Two solutions for automatically adding 0 to js regular format date and time

Table of contents background Solution 1 Ideas: Co...

How to install MySQL and Redis in Docker

This article is based on the CentOS 7.3 system en...

Solution to the MySQL error "Every derived table must have its own alias"

MySQL reports an error when executing multi-table...

Detailed usage of docker-maven-plugin

Table of contents Docker-Maven-Plugin Maven plugi...

React implements a general skeleton screen component example

Table of contents What is a skeleton screen? Demo...

A brief introduction to MySQL functions

Table of contents 1. Mathematical functions 2. St...

JS realizes the card dealing animation

This article example shares the specific code of ...