javascript - 如图,button按钮,当鼠标覆盖或者点击的时候,如何用css让她有悬浮、阴影、发光的感觉?
本文介绍了javascript - 如图,button按钮,当鼠标覆盖或者点击的时候,如何用css让她有悬浮、阴影、发光的感觉?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
解决方案
给你写了个小例子,直接复制过去就能看了~
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.myBtn{
width: 80px;
height: 36px;
background-color:#20A0FF;
color: white;
border: none;
cursor: pointer;
/*渐变效果,可以删掉这句话试试*/
transition:all 0.8s;
}
.myBtn:hover{
/*鼠标悬浮效果*/
/*阴影*/
box-shadow: 5px 5px 5px grey;
/*发光*/
background-color: #58B7FF;
}
</style>
</head>
<body>
<button class="myBtn">举个栗子</button>
</body>
</html>
这篇关于javascript - 如图,button按钮,当鼠标覆盖或者点击的时候,如何用css让她有悬浮、阴影、发光的感觉?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文