This article mainly introduces the specific steps of making a beautiful photo wall with CSS3 in detail. It has certain reference value. Interested friends can refer to it.
The examples in this article are to share with you the use of CSS3 The detailed steps for creating an animated photo wall are for your reference. The specific content is as follows
The first effect:
The Html code is as follows:
照片墙制作
The CSS code is as follows:
Effect picture:
The second implementation effect:
Part One:HTML
Here we first put ten pictures on the page. (If you have any beautiful photos, please post them!)
Part 2:CSS3
This part is the focus of our section, As shown in the picture above, the positions of the photos are different. We will definitely use the following knowledge points of CSS3:
CSS3 rotation rotate
CSS3 scaling
CSS3 shadow box- shadow
Yes, with these functions we can make a beautiful photo wall. Let’s take a look at our code. Only part of the code is shown here. Smart friends must know how to do it!
body{ background: url(../img/bg1.jpg) no-repeat top center fixed; background-size: 100% auto; } .content{ width: 900px; height: 1000px; overflow: hidden; margin: 100px auto; position: relative; } img{ z-index: 1; width: 20%; height: auto; position: absolute; padding: 10px 10px 15px 10px; background: #ffffff; border: 1px solid #CCCCCC; /* 动画的时间 */ -moz-transition: 0.5s; -webkit-transition: 0.5s; transition: 0.5s; } img:hover{ z-index: 2; transform: scale(1.5); -moz-transform: scale(1.5) ; -webkit-transform: scale(1.5) ; box-shadow: -10px 10px 20px #000000; -moz-box-shadow: -10px 10px 20px #000000; -webkit-box-shadow: -10px 10px 20px #000000; } .pic1{ left: 100px; top: 50px; -webkit-transform: rotate(20deg); -moz-transform: rotate(20deg); transform: rotate(20deg); } .pic2{ left: 280px; top: 60px; -webkit-transform: rotate(-10deg); -moz-transform: rotate(-10deg); transform: rotate(-10deg); } /* 下面的代码大同小异就不依依展示了 */
Such a simple code can achieve the effect shown in the picture above. Friends, if you are interested, try it yourself and post your beautiful photos to see.
PS: CSS3 can also create more wonderful and gorgeous effects. If you are interested, you can study it in depth!
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
How to implement single-line and multi-line text overflow display ellipses using CSS
How to implement css icons Align with text
The above is the detailed content of Use CSS3 to create special effects for photo walls. For more information, please follow other related articles on the PHP Chinese website!