使用 CSS 为按钮悬停添加渐现效果
您可以尝试运行以下代码,使用 CSS 为按钮悬停添加渐现效果
示例
<!DOCTYPE html>
<html>
<head>
<style>
.btn {
background-color: orange;
color: white;
padding: 10px;
text-align: center;
font-size: 16px;
margin: 5px;
opacity: 0.5;
transition: 0.5s;
display: inline-block;
text-decoration: none;
cursor: pointer;
}
.btn:hover {
opacity: 2
}
</style>
</head>
<body>
<button class = "btn">Result</button>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
JavaScript
PHP