Pure CSS for photo wall 3D effect

Source: Internet
Author: User
This time to bring you a pure CSS to achieve the 3D effect of photo wall, pure CSS to achieve the 3D effect of the photo wall, the following is the actual case, together to see.

Directly on the code

1. Preparation Materials:

Preparation material is no material, their own slip quickly go: Baidu find a few pictures of beauty to test can.

2.html Code:

<! DOCTYPE html>

3.css Code:

* {margin:0; padding:0;} Body {background-color: #eee;}.    container {width:960px;    height:450px;    margin:60px Auto; Position:relative;}. The img {/* Width can be set according to the photo content of your choice */width:150px;}.    Container Img:hover {box-shadow:15px 15px 20px rgba (50,50,50,0.4);    Transform:rotate3d (1,1,1,180deg) scale (1.50);    -webkit-transform:rotate3d (1,1,1,180deg) scale (1.50);    -moz-transform:rotate3d (0deg,0deg,0deg) scale (1.50);    -ms-transform:rotate3d (0deg,0deg,0deg) scale (1.50); /* itself picture of the Z-index is 1, the mouse after the time set to 2, then this picture will be "up" */z-index:2;}.    Container img {/* Add a picture frame effect to the photo */padding:10px 10px 15px;    Background-color:white;    border:1px solid #ddd;    box-shadow:2px 2px 3px Rgba (50,50,50,0.4);    /* Fade out animation effect */-moz-transition:all 0.5s ease-in;    -o-transition:all 0.5s ease-in;    -webkit-transition:all 0.5s ease-in;    Transition:all 0.5s ease-in; Z-index:1;}.    IMG1 {left:400px;    top:0; /*CSS3 Properties Transform: Rotation: Rotate, scaling: scale, tilt: Skew */transform:rotate ( -5dEG);    /*-webkit represents Chrome, Safari private properties */-webkit-transform:rotate ( -5DEG);    /*-moz represents the private properties of the Firefox browser */-moz-transform:rotate ( -5DEG); /*-ms represents the private properties of IE Browser */-ms-transform:rotate ( -5DEG);}.    Img2 {left:600px;    top:0;    /* Rotation angle can be determined according to their own aesthetics */transform:rotate ( -20DEG);    -webkit-transform:rotate ( -20DEG);    -moz-transform:rotate ( -20DEG); -ms-transform:rotate ( -20deg);}.    IMG3 {bottom:0px;    right:0;    Transform:rotate (5DEG);    -webkit-transform:rotate (5DEG);    -moz-transform:rotate (5DEG); -ms-transform:rotate (5deg);}.    IMG4 {bottom:400px;    left:300px;    Transform:rotate ( -10DEG);    -webkit-transform:rotate ( -10DEG);    -moz-transform:rotate ( -10DEG); -ms-transform:rotate ( -10deg);}.    img5 {bottom:0px;    top:0;    Transform:rotate ( -10DEG);    -webkit-transform:rotate ( -10DEG);    -moz-transform:rotate ( -10DEG); -ms-transform:rotate ( -10deg);}.    Img6 {left:0px;    top:0;    Transform:rotate (10DEG);    -webkit-transform:rotate (10DEG); -moz-transform:rotate (10DEG); -ms-transform:rotate (10deg);}.    Img7 {left:850px;    top:0;    Transform:rotate (20DEG);    -webkit-transform:rotate (20DEG);    -moz-transform:rotate (20DEG); -ms-transform:rotate (20deg);}.    Img8 {bottom:-20px;    top:650px;    Transform:rotate (5DEG);    -webkit-transform:rotate (5DEG);    -moz-transform:rotate (5DEG); -ms-transform:rotate (5deg);}.    img9 {left:550px;    top:100px;    Transform:rotate (15DEG);    -webkit-transform:rotate (15DEG);    -moz-transform:rotate (15DEG); -ms-transform:rotate (15deg);}

CSS code These comments are also warm, you can see for yourself, you can change some of the properties to play more.

4. Effect Demo:

Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!

Recommended reading:

CSS3 of linear-gradient linear gradient using method

The Mask-image property of CSS is detailed

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.