Skip to content
Advertisements

CSS Animation Card


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="animation6.css">
</head>
<body>

    <div class="container">
        <img src="https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/a9bb3952869829.591f43fac9872.png">
        <img src="https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/a9bb3952869829.591f43fac9872.png">
        <img src="https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/a9bb3952869829.591f43fac9872.png">
        <img src="https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/a9bb3952869829.591f43fac9872.png">

    </div>

</body>
</html>

CSS CODE:

body{
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.container{
  position: relative;
  width:360px;
  height: 640px;
  margin-top: 150px;
  background: rgba(0,0,0,.1);
  transform: rotate(-30deg) skew(25deg) scale(.8);
  transition: 1s;
}
.container img{
  position: absolute;
  width: 100%;
  transition:1s;
}
.container:hover img:nth-child(4)
{
  transform: translate(160px,-160px);
}
.container:hover img:nth-child(3)
{
  transform: translate(120px,-120px);
  opacity: .8;
}
.container:hover img:nth-child(2)
{
  transform: translate(80px,-80px);
  opacity: .6;
}
.container:hover img:nth-child(1)
{
  transform: translate(40px,-40px);
  opacity: .4;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: