使用 CSS 为按钮添加透明度
要为按钮添加透明度,请使用 CSS opacity 属性。这将为按钮创建禁用外观。
你可以尝试运行以下代码为按钮添加透明度
示例
<!DOCTYPE html>
<html>
<head>
<style>
.btn1 {
color: black;
text-align: center;
font-size: 15px;
}
.btn2 {
color: black;
text-align: center;
font-size: 15px;
opacity: 0.8;
}
</style>
</head>
<body>
<h2>Result</h2>
<p>Click below for result:</p>
<button class = "btn1">Enabled</button>
<button class = "btn2">Disabled</button>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP