translate

translate的百分比好像是根据该元素的宽高来定的

比如 

.btn{position:relative; width: 150px; height: 40px; line-height: 40px; border: 1px solid #ddd; color: #333; text-align: center; margin-right: 30px; float: left;  transition: all 1s linear;}

.btn span{
position: absolute;
top:0;
left: 50%;//相对btn元素而言偏移75px
width: 500px;
height: 500px;
display: block;
transition: all .4s linear;
z-index: -1;
border-radius: 50%;
transform:translate(-50%,-50%);//对原来位置偏移250px
}

 

posted @ 2016-04-12 17:35  冬暑  阅读(210)  评论(0编辑  收藏  举报