div或button一些好看实用的 CSS 样式示例

1:现代渐变按钮

css 复制代码
.count {
  width: 800px;
  background: linear-gradient(135deg, #72EDF2 0%, #5151E5 100%);
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(81, 81, 229, 0.3);
  color: white;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.count:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(81, 81, 229, 0.4);
}

2:磨砂玻璃效果(适合现代UI)

css 复制代码
.count {
  width: 800px;
  background: rgba(135, 206, 235, 0.7);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #333;
  transition: all 0.3s ease;
}

.count:hover {
  background: rgba(135, 206, 235, 0.9);
}

3:3D立体按钮

css 复制代码
.count {
  width: 800px;
  background-color: #4CAF50;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 5px 0 #3e8e41,
              0 10px 10px rgba(0, 0, 0, 0.1);
  color: white;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  top: 0;
}

.count:active {
  top: 5px;
  box-shadow: 0 2px 0 #3e8e41,
              0 5px 5px rgba(0, 0, 0, 0.1);
}

4: 简约边框样式

css 复制代码
.count {
  width: 800px;
  background-color: transparent;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid skyblue;
  color: skyblue;
  font-weight: bold;
  text-align: center;
  transition: all 0.3s ease;
}

.count:hover {
  background-color: skyblue;
  color: white;
  box-shadow: 0 0 15px rgba(135, 206, 235, 0.5);
}

5: 霓虹发光效果

css 复制代码
.count {
  width: 800px;
  background-color: #1e1e2f;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid #00ffff;
  color: #00ffff;
  text-align: center;
  box-shadow: 0 0 10px #00ffff,
              inset 0 0 10px #00ffff;
  text-shadow: 0 0 5px #00ffff;
  transition: all 0.3s ease;
}

.count:hover {
  box-shadow: 0 0 20px #00ffff,
              inset 0 0 15px #00ffff;
}

6:圆角卡片样式

css 复制代码
.count {
  width: 800px;
  background-color: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}

.count:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

7:常用div简约

css 复制代码
.count {
  background-color: skyblue;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px;
}
相关推荐
AverageJoe199113 分钟前
一次vite热更新不生效问题排查
前端·debug·vite
努力只为躺平15 分钟前
🔥 油猴脚本开发指南:从基础API到发布全流程
前端·javascript
bitbitDown16 分钟前
我用Playwright爬了掘金热榜,发现了这些有趣的秘密... 🕵️‍♂️
前端·javascript·vue.js
陈随易21 分钟前
VSCode v1.102发布,AI体验大幅提升
前端·后端·程序员
ma7725 分钟前
JavaScript 获取短链接原始地址的解决方案
前端
该用户已不存在25 分钟前
关于我把Mac Mini托管到机房,后续来了,还有更多玩法
服务器·前端·mac
tianchang28 分钟前
SSR 深度解析:从原理到实践的完整指南
前端·vue.js·设计模式
闲蛋小超人笑嘻嘻29 分钟前
前端面试十一之TS
前端
摆烂为不摆烂30 分钟前
😁深入JS(四): 一文让你完全了解Iterator+Generator 实现async await
前端
DoraBigHead42 分钟前
🧠 别急着传!大文件上传里,藏着 Promise 的高级用法
前端·javascript·面试