码迷,mamicode.com
首页 > Web开发 > 详细

CSS3入门--线条动画特效实例

时间:2016-01-12 19:24:24      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

HTML:

<div></div>

CSS:

  div{ 

      width: 200px; height: 200px; margin: 200px auto; background: #000; 
      position: relative;-webkit-backface-visibility: hidden;
    backface-visibility: hidden;}
     div::after{   
        border-right: 1px solid #fff;
        border-left: 1px solid #fff;
        -webkit-transform: scale(1,0);
        transform: scale(1,0);
                }
     div::before{ 
                border-top: 1px solid #fff;
        border-bottom: 1px solid #fff;
        -webkit-transform: scale(0,1);
        transform: scale(0,1);

     }
     div::before,div::after{
    position:absolute;
  top:30px;
  right:30px;
  bottom:30px;
  left:30px;
  content:‘‘;
  opacity:0;
  -webkit-transition:opacity .35s,-webkit-transform .35s;
  transition:opacity .35s,transform .35s
   pointer-events: none;
     }
     
     div:hover::after,div:hover::before {
  opacity:1;
  -webkit-transform:scale(1);
  transform:scale(1)
}

     body{background: yellowgreen;}
     *, :after, :before, input[type=search] {
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    text-align: center;
}

demo:http://paul-xiao.github.io/demo/

CSS3入门--线条动画特效实例

标签:

原文地址:http://www.cnblogs.com/paul-xiao/p/5125212.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!