下面是鼠标悬停时的样式:
源代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.main{
margin-top:200px;
width:500px;
height:500px;
margin:0 auto;
border:1px solid springgreen;
}
.button{
margin:0 auto;
margin-top:50px;
width:150px;
height:50px;
line-height:50px;
font-size:20px;
color:#00f;
background-color:#30d0c6;
transition:all 1s linear;
}
.button:hover{
color:#fff;
background-color:#f70b65;
border-radius:30px
}
.button1{
margin:0 auto;
margin-top:100px;
width:100px;
height:100px;
background-color: springgreen;
transition:all 1s linear;
}
.button1:hover{
color:#fff;
background-color: tomato;
border-radius: 50%;
}
</style>
</head>
<body>
<div class="main">
<div class="button1"></div>
<div class="button"></div>
</div>
</body>
</html>