合理布局和排版实例教程 纯css3完成照片3角形排

日期:2021-01-20 类型:科技新闻 

关键词:网页设计,移动端网页设计,大一网页设计作业成品,网页编辑软件,网页在线编辑

  现今是个读图时期。纯绝大多数网页页面或多或少都会用到照片。非常是照片较多的网页页面。照片的合理布局和排版就十分关键了。今日要给大写带来1款纯css3完成照片3角形排序。合适1系列的照片。实际效果图以下:

  完成的编码能够有两种:html编码和css3编码,实际以下

  html编码:


拷贝编码
编码以下:
  <div class='container'>
<div class='wrap'>
<div class='crop'>
<img src='128.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='129.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='130.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='131.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='132.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='133.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='134.jpg'>
</div>
</div>
<div class='wrap'>
<div class='crop'>
<img src='135.jpg'>
</div>
</div>
</div>

  css3编码:


拷贝编码
编码以下:
body
{
background: #f1f1fa;
}

.container
{
margin: 140px auto 0;
font-size: 0;
max-width: 560px;
}

.wrap
{
-webkit-transform: rotate(45deg) translate3d(0, 0, 0);
-moz-transform: rotate(45deg) translate3d(0, 0, 0);
-ms-transform: rotate(45deg) translate3d(0, 0, 0);
-o-transform: rotate(45deg) translate3d(0, 0, 0);
transform: rotate(45deg) translate3d(0, 0, 0);
display: inline-block;
-webkit-transition: -webkit-transform 300ms ease-out;
-moz-transition: -moz-transform 300ms ease-out;
transition: transform 300ms ease-out;
width: 100px;
}
.wrap:hover
{
-webkit-transition: -webkit-transform 700ms ease-out;
-moz-transition: -moz-transform 700ms ease-out;
transition: transform 700ms ease-out;
-webkit-transform: rotate(45deg) translate3d(10px, 10px, 0);
-moz-transform: rotate(45deg) translate3d(10px, 10px, 0);
-ms-transform: rotate(45deg) translate3d(10px, 10px, 0);
-o-transform: rotate(45deg) translate3d(10px, 10px, 0);
transform: rotate(45deg) translate3d(10px, 10px, 0);
}
.wrap:nth-child(even)
{
width: 40px;
-webkit-transform: rotate(225deg) translate3d(30px, 120px, 0);
-moz-transform: rotate(225deg) translate3d(30px, 120px, 0);
-ms-transform: rotate(225deg) translate3d(30px, 120px, 0);
-o-transform: rotate(225deg) translate3d(30px, 120px, 0);
transform: rotate(225deg) translate3d(30px, 120px, 0);
}
.wrap:nth-child(even) .crop img
{
-webkit-transform: skew(⑵0deg, ⑵0deg) rotate(⑵25deg);
-moz-transform: skew(⑵0deg, ⑵0deg) rotate(⑵25deg);
-ms-transform: skew(⑵0deg, ⑵0deg) rotate(⑵25deg);
-o-transform: skew(⑵0deg, ⑵0deg) rotate(⑵25deg);
transform: skew(⑵0deg, ⑵0deg) rotate(⑵25deg);
}
.wrap:nth-child(even):hover
{
-webkit-transform: rotate(225deg) translate3d(40px, 130px, 0);
-moz-transform: rotate(225deg) translate3d(40px, 130px, 0);
-ms-transform: rotate(225deg) translate3d(40px, 130px, 0);
-o-transform: rotate(225deg) translate3d(40px, 130px, 0);
transform: rotate(225deg) translate3d(40px, 130px, 0);
}

.crop
{
position: relative;
width: 160px;
height: 160px;
margin: 0;
display: block;
overflow: hidden;
-webkit-transform: skew(20deg, 20deg) translate3d(0, 0, 0);
-moz-transform: skew(20deg, 20deg) translate3d(0, 0, 0);
-ms-transform: skew(20deg, 20deg) translate3d(0, 0, 0);
-o-transform: skew(20deg, 20deg) translate3d(0, 0, 0);
transform: skew(20deg, 20deg) translate3d(0, 0, 0);
}
.crop img
{
width: 160px;
height: 160px;
position: absolute;
left: ⑸0%;
margin-top: 36px;
margin-left: 36px;
top: ⑸0%;
-webkit-transform: skew(⑵0deg, ⑵0deg) rotate(⑷5deg);
-moz-transform: skew(⑵0deg, ⑵0deg) rotate(⑷5deg);
-ms-transform: skew(⑵0deg, ⑵0deg) rotate(⑷5deg);
-o-transform: skew(⑵0deg, ⑵0deg) rotate(⑷5deg);
transform: skew(⑵0deg, ⑵0deg) rotate(⑷5deg);
opacity: 0.7;
-webkit-transition: opacity 300ms ease-in-out;
-moz-transition: opacity 300ms ease-in-out;
transition: opacity 300ms ease-in-out;
}
.crop img:hover
{
opacity: 1;
}

上一篇:CSS Hack详解 返回下一篇:没有了