手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >利用CSS3实现开门效果实例源码
利用CSS3实现开门效果实例源码
摘要:先来看看效果图以下实例源码css3开门.door{position:relative;width:400px;height:300px;ov...

先来看看效果图

以下实例源码

<!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>

<div>1</div>

<div>1</div>

</div></p> <p><script type="text/javascript">

</script>

</body>

</html>

总结

以上就是利用CSS3实现开门效果的全部内容,刚兴趣的朋友们自己动手试试看效果,希望本文对大家学习使用CSS3能有所帮助。

【利用CSS3实现开门效果实例源码】相关文章:

CSS相框效果示例代码

怎样用CSS实现大背景网页效果

纯CSS代码实现翻页焦点图效果

用css实现十字的布局示例代码

css3实现input输入框颜色渐变发光效果代码

巧用CSS3 border实现图片遮罩效果代码

CSS实现圆柱型数据报表的方法

CSS UL LI布局实现表格效果

利用css实现图片等比例缩放

利用CSS实现禁止双击选择页面内容的实例展示

精品推荐
分类导航