CSS鼠标滑过翻转动画图标

html/css鼠标放上去变大效果

效果如下动态图:
请添加图片描述

目录层级
在这里插入图片描述

代码如下:
html文件
index.html

<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>CSS3鼠标滑过翻转动画图标DEMO演示</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>

<body>

<div class="main-wrapper">
		<i class="material-icons">attach_file</i>
		<i class="material-icons">settings</i>
		<i class="material-icons">refresh</i>
		<i class="material-icons">search</i>
		<i class="material-icons">explore</i>
		<i class="material-icons">public</i>
		<i class="material-icons">autorenew</i>
		<i class="material-icons">add</i>
</div>
<div style="text-align:center;clear:both">
<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>
<script src="/follow.js" type="text/javascript"></script>
</div>
</body>
</html>

css文件
style.css

@import url(https://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic);
* {
		font-family: "Roboto", Arial, sans-serif;
}

body {
		font-size: 1rem;
		background-color: #ebebeb;
		padding: 20px;
		text-align: center;
}

h1 {
		font-weight: 100;
		color: #777;
}

.main-wrapper {
		border-radius: 4px;
		background-color: white;
		padding: 20px;
		box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
		position: relative;
}

i.material-icons {
		font-size: 1.5rem;
		color: white;
		position: relative;
		border-radius: 50%;
		padding: 5px;
		margin: 3px;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
		transition: color 0.2s ease, background-color 0.2s ease, transform 0.3s ease;
}

i.material-icons:after {
		content: "";
		width: 100%;
		height: 100%;
		border: solid 2px;
		transform: scale(0.8);
		position: absolute;
		top: -2px;
		left: -2px;
		border-radius: 50%;
		transition: all 0.3s ease;
}

i.material-icons:hover:after {
		transform: scale(1);
		box-shadow: 10px 0 20px rgba(0, 0, 0, 0.19), 6px 0 6px rgba(0, 0, 0, 0.23);
}

i.material-icons:nth-of-type(4) {
		background-color: #88b999;
}

i.material-icons:nth-of-type(4):hover {
		color: #88b999;
}

i.material-icons:nth-of-type(4):after {
		border-color: #88b999;
}

i.material-icons:nth-of-type(5) {
		background-color: #88b2b9;
}

i.material-icons:nth-of-type(5):hover {
		color: #88b2b9;
}

i.material-icons:nth-of-type(5):after {
		border-color: #88b2b9;
}

i.material-icons:nth-of-type(6) {
		background-color: #8897b9;
}

i.material-icons:nth-of-type(6):hover {
		color: #8897b9;
}

i.material-icons:nth-of-type(6):after {
		border-color: #8897b9;
}

i.material-icons:nth-of-type(7) {
		background-color: #af88b9;
}

i.material-icons:nth-of-type(7):hover {
		color: #af88b9;
}

i.material-icons:nth-of-type(7):after {
		border-color: #af88b9;
}

i.material-icons:nth-of-type(8) {
		background-color: #d59acb;
}

i.material-icons:nth-of-type(8):hover {
		color: #d59acb;
}

i.material-icons:nth-of-type(8):after {
		border-color: #d59acb;
}

i.material-icons:nth-of-type(1) {
		background-color: #cd8484;
}

i.material-icons:nth-of-type(1):hover {
		color: #cd8484;
}

i.material-icons:nth-of-type(1):after {
		border-color: #cd8484;
}

i.material-icons:nth-of-type(2) {
		background-color: #ec9f83;
}

i.material-icons:nth-of-type(2):hover {
		color: #ec9f83;
}

i.material-icons:nth-of-type(2):after {
		border-color: #ec9f83;
}

i.material-icons:nth-of-type(3) {
		background-color: #cdb274;
}

i.material-icons:nth-of-type(3):hover {
		color: #cdb274;
}

i.material-icons:nth-of-type(3):after {
		border-color: #cdb274;
}

i.material-icons:hover {
		background-color: transparent;
		transform: rotate(90deg);
		cursor: pointer;
		box-shadow: none;
}

p {
		color: #999;
		font-weight: 300;
		margin-top: 20px;
}

@media (min-width:601px) {
	i.material-icons {
		padding:10px;
		margin:5px;
		font-size:2rem;
	}
}

@media (min-width:993px) {
	i.material-icons {
		padding:20px;
		margin:10px;
		font-size:4rem;
	}
	i.material-icons:after {
		border-width:3px;
		top:-3px;
		left:-3px;
	}
}

请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

编程ID

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值