微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

怎么使用CSS3实现折角效果

这篇文章主要介绍“怎么使用CSS3实现折角效果”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“怎么使用CSS3实现折角效果文章能帮助大家解决问题。

先来看看静态的效果

怎么使用CSS3实现折角效果

怎么使用CSS3实现折角效果

实例代码

<!DOCTYPE html>
<html>
<head>
 <Meta charset="UTF-8">
 <title></title>
 <style>
 body {
  background-color: #eaf0f2;
 }
  h2{text-align: center;}
  .Box{width:500px;height:300px;margin:0 auto;position:relative;}
  .img-layer{position: absolute;width: 500px;height: 300px;top: 0;left: 0;overflow: hidden;}
  .img-layer img {width: 500px;cursor: pointer;}
  .img-layer:before{ content: '';
   position: absolute;
   top: 0;
   right: 0;
   width: 0;
   height: 0;
   border-style: solid;
   border-width: 0;
   border-color: rgba(0,0,0,0.2) #fff;
   border-radius: 0 0 0 4px;
   Box-shadow: 0 1px 1px rgba(0,0,0,0.3), -1px 1px 1px rgba(0,0,0,0.2);
   -webkit-transition: all 0.4s ease-out;
   transition:all 0.4s ease-out;}
 .img-layer:hover:before{
   border-right-width:100px;
   border-bottom-width:100px;
 }
 </style>
</head>
<body>
 <h2>折角效果</h2>
 <div class="Box">
  <div class="img-layer">
    <img src="<a href="http://p6.qhimg.com/d/inn/3f563406/table.jpg">http://p6.qhimg.com/d/inn/3f563406/table.jpg</a>" alt="">
  </div>
 </div>
</body>
</html>

关于“怎么使用CSS3实现折角效果”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识,可以关注编程之家行业资讯频道,小编每天都会为大家更新不同的知识点。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐