CSS3中怎么实现开门效果

本篇文章给大家分享的是有关CSS3中怎么实现开门效果,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

创新互联主要从事成都做网站、成都网站建设、网页设计、企业做网站、公司建网站等业务。立足成都服务栾川,十余年网站建设经验,价格优惠、服务专业,欢迎来电咨询建站服务:13518219792

代码如下:

<!DOCTYPE html>
<html>
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>css3开门</title>
  <style type="text/css">
   .door{ position:relative; width:400px; height:300px; overflow:hidden; border:2px solid #000; background:#000;}
   .door:before,.door:after{ content:''; position:absolute; left:0; width:0; height:0; overflow:hidden; border-color:#000 transparent transparent transparent; border-style:solid; border-width:0 200px; z-index:2; transition:all .8s ease;}
   .door:before{ top:0;}
   .door:after{ bottom:0; border-color:transparent transparent #000 transparent;}
   .door:hover:before,.door:hover:after{ border-width:40px 200px;}
   .door-left, .door-right{ position:relative; float:left; width:50%; height:100%; background: #64DE27; box-sizing:border-box; transition:all .5s ease;}
   .door-left{ border-right:2px solid #000; -webkit-transform-origin:0 0;}
   .door-left:before,.door-right:before{ content:''; position:absolute; width:10px; height:10px; top:50%; margin-top:-5px; border-radius:50%; background:#000;}
   .door-left:before{ right:5px;}
   .door-right:before{ left:5px;}
   .door-right{ border-left:2px solid #000; -webkit-transform-origin:100% 0;}
   .door:hover .door-left{ -webkit-transform:rotateY(-90deg);   transition:transform 2s Linear}
   .door:hover .door-right{ -webkit-transform:rotateY(90deg);   transition:transform 2s Linear}
  </style>
 
 </head>
 <body>
 <div class="door">
     <div class="door-left">1</div>
     <div class="door-right">1</div>
 </div></p>
<p><script type="text/javascript">
</script>
 </body>
</html>

以上就是CSS3中怎么实现开门效果,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联行业资讯频道。

本文标题:CSS3中怎么实现开门效果
网站路径:https://www.cdcxhl.com/article26/gecgjg.html

成都网站建设公司_创新互联,为您提供App开发网站收录建站公司服务器托管做网站虚拟主机

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站建设