Files
workspace/code/base-project/base-vue/test.html
T
2025-09-01 17:30:41 +08:00

47 lines
1.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AntD 风格按钮点击反馈</title>
<style>
/* 基础按钮样式 */
.btn {
background-color: #1677ff; /* 主色 */
color: #fff;
border: none;
padding: 10px 24px;
font-size: 16px;
border-radius: 6px;
cursor: pointer;
transition: all 0.15s ease;
position: relative;
outline: none;
}
/* hover 高亮 */
.btn:hover:not(:disabled) {
background-color: #4096ff; /* 调亮 */
}
/* 按下 active 效果 */
.btn:active:not(:disabled) {
background-color: #0958d9; /* 调暗 */
transform: translateY(1px); /* 轻微下移,模拟按下 */
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); /* 按下阴影 */
}
/* disabled 状态 */
.btn:disabled {
background-color: #cfe0ff;
color: #a0bfff;
cursor: not-allowed;
}
</style>
</head>
<body>
<button class="btn">Primary Button</button>
<button class="btn" disabled>Disabled</button>
</body>
</html>