HTML+CSS鼠标悬停效果
2024-10-19 00:24:17
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);
}
效果:
最新文章
- js 的 protype 小总结
- Neutron 网络基本概念 - 每天5分钟玩转 OpenStack(66)
- geotrellis使用(三)geotrellis数据处理过程分析
- js学习笔记---事件代理
- 配置使用EF6.0常见的一些问题及解决方案
- 使用vs2010生成SQL Server 随机数据
- VR可以用做除游戏外的哪些地方
- Oracle基础语法
- 虚拟机中的centos在nat模式下连不上外网
- [android] SQLite 数据库的升级 和 降级
- 关于jquery easyui treegrid的问题
- 内存映射文件详解-----C++实现
- Java类加载及实例化的调用顺序
- 使用JS截取字符串函数详解
- Self Numbers
- python 接口自动化测试(三)
- Python3玩转儿 机器学习(4)
- leetcode5:最长回文子串
- MT4下载历史数据
- asyncio模块中的Future和Task
热门文章
- Mybatis-Plus的填坑之路 - Lynwood/wunian7yulian
- cmake-index-3.11.4机翻
- Paper Reading - Show and Tell: A Neural Image Caption Generator ( CVPR 2015 )
- redis与mysql性能对比、redis缓存穿透、缓存雪崩
- 市场营销的4c原则
- Live Archive 训练题 2019/3/9
- JDK源码分析 – HashMap
- Qt多线程-QThread
- 【Java】对ArrayList排序
- 小程序 坐标算距离 (copy)