头闻号

佛山市南海区金沙金洲涂料实业有限公司

金属漆|色浆|环氧涂料|船舶涂料|木器涂料|特种涂料

首页 > 新闻中心 > 科技常识:一款纯css3实现的鼠标悬停动画按钮
科技常识:一款纯css3实现的鼠标悬停动画按钮
发布时间:2024-10-06 01:38:53        浏览次数:8        返回列表

今天小编跟大家讲解下有关一款纯css3实现的鼠标悬停动画按钮 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关一款纯css3实现的鼠标悬停动画按钮 的相关资料,希望小伙伴们看了有所帮助。

  今天给大家带来一款纯css3实现的鼠标悬停动画按钮。这款按钮鼠标经过前以正方形的形式 当鼠标经过的时候以动画的形式变成圆形。效果图如下:

  实现的代码。

  html代码:

复制内容到剪贴板 <div> <span></span> </div>

  css3代码:

CSS Code复制内容到剪贴板 body { background-color:#333; } div { width:200px; height:200px; margin:0auto; } span { position:relative; width:180px; height:180px; display:block; margin:auto; top:25px; border:20pxsolidrgba(255,255,0,.25); background-color:rgba(124,155,13,1); -webkit-transition:.5s; -moz-transition:.5s; -ms-transition:.5s; transition:.5s; border-radius:30px0px30px0px; } span:before,span:after { position:absolute; display:block; background-color:#fff; border-radius:10px; margin:auto; top:0px; bottombottom:0px; left:0px; rightright:0px; } span:before { width:100px; height:10px; content:""; } span:after { width:10px; height:100px; content:""; } div:hoverspan { -webkit-transform:scale(.5)rotate(45deg); -moz-transform:scale(.5)rotate(45deg); -ms-transform:scale(.5)rotate(45deg); transform:scale(.5)rotate(45deg); border-radius:110px; background-color:rgba(112,18,255,1); }

来源:爱蒂网