HTML+CSS实现鼠标悬停效果

HTML:

<link href="style.css" rel="stylesheet">

<a class="social" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-facebook"></i>
</div>
<div class="back">
<i class="fa fa-facebook"></i>
</div>
</a> <a class="social social-twitter" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-twitter"></i>
</div>
<div class="back">
<i class="fa fa-twitter"></i>
</div>
</a> <a class="social social-github" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-github"></i>
</div>
<div class="back">
<i class="fa fa-github"></i>
</div>
</a> <a class="social social-pinterest" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-pinterest"></i>
</div>
<div class="back">
<i class="fa fa-pinterest"></i>
</div>
</a> <a class="social social-googleplus" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-google-plus"></i>
</div>
<div class="back">
<i class="fa fa-google-plus"></i>
</div>
</a> <a class="social social-skype" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-skype"></i>
</div>
<div class="back">
<i class="fa fa-skype"></i>
</div>
</a> <a class="social social-linkedin" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-linkedin"></i>
</div>
<div class="back">
<i class="fa fa-linkedin"></i>
</div>
</a> <a class="social social-skype" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-skype"></i>
</div>
<div class="back">
<i class="fa fa-skype"></i>
</div>
</a> <a class="social social-dribbble" href="https://webbb.be" target="_blank">
<div class="front">
<i class="fa fa-dribbble"></i>
</div>
<div class="back">
<i class="fa fa-dribbble"></i>
</div>
</a>

CSS:

/**
* CSS3 social icon hover effect
* Read more on my blog: http://webbb.be/blog/
*/ body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
a,a:visited { color: #fff; }
a:hover { color: #fff; } .social {
float: left;
margin: 2em 2em; width: 100px; height: 100px;
display: block; text-align: center; line-height:103px; color: #fff; position: relative;
transform:rotateY(0deg);
transition:transform .25s ease-out;
transform-style:preserve-3d;
}
.social > div {
width: 100px; height: 100px; background: #000;
position: absolute; top:; left:; right:; bottom:;
}
.social >.front {
transform:translateZ(40px);
}
.social >.back {
background: #3B5998; font-size: 3em;
transform:rotateY(-100deg) translateZ(40px);
} /* Social Media Colors
Facebook #3B5998
Flickr #FE0883
Foursquare #8FD400
Google+ #C63D2D
Instagram #4E433C
Linkedin #4875B4
Tumblr #2B4964
Twitter #33CCFF
Vimeo #86B32D
Youtube #FF3333
Dribbble #ea4c89
*/
.social.social-twitter > .back { background: #55ACEE; }
.social.social-github > .back { background: #f3f3f3; color: #000; }
.social.social-pinterest > .back { background: #e3262e; }
.social.social-googleplus > .back { background: #dd4B39; }
.social.social-skype > .back { background: #12A5F4; }
.social.social-linkedin > .back { background: #4875B4; }
.social.social-dribbble > .back { background: #ea4c89; } /* Hover */
.social:hover {
transform: rotateY(100deg);
}

效果:

最新文章

  1. js 的 protype 小总结
  2. Neutron 网络基本概念 - 每天5分钟玩转 OpenStack(66)
  3. geotrellis使用(三)geotrellis数据处理过程分析
  4. js学习笔记---事件代理
  5. 配置使用EF6.0常见的一些问题及解决方案
  6. 使用vs2010生成SQL Server 随机数据
  7. VR可以用做除游戏外的哪些地方
  8. Oracle基础语法
  9. 虚拟机中的centos在nat模式下连不上外网
  10. [android] SQLite 数据库的升级 和 降级
  11. 关于jquery easyui treegrid的问题
  12. 内存映射文件详解-----C++实现
  13. Java类加载及实例化的调用顺序
  14. 使用JS截取字符串函数详解
  15. Self Numbers
  16. python 接口自动化测试(三)
  17. Python3玩转儿 机器学习(4)
  18. leetcode5:最长回文子串
  19. MT4下载历史数据
  20. asyncio模块中的Future和Task

热门文章

  1. Mybatis-Plus的填坑之路 - Lynwood/wunian7yulian
  2. cmake-index-3.11.4机翻
  3. Paper Reading - Show and Tell: A Neural Image Caption Generator ( CVPR 2015 )
  4. redis与mysql性能对比、redis缓存穿透、缓存雪崩
  5. 市场营销的4c原则
  6. Live Archive 训练题 2019/3/9
  7. JDK源码分析 – HashMap
  8. Qt多线程-QThread
  9. 【Java】对ArrayList排序
  10. 小程序 坐标算距离 (copy)