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;
}
相关推荐
z***75152 小时前
【Springboot3+vue3】从零到一搭建Springboot3+vue3前后端分离项目之后端环境搭建
android·前端·后端
fruge3 小时前
仿写优秀组件:还原 Element Plus 的 Dialog 弹窗核心逻辑
前端
an86950013 小时前
vue新建项目
前端·javascript·vue.js
w***95493 小时前
SQL美化器:sql-beautify安装与配置完全指南
android·前端·后端
顾安r4 小时前
11.22 脚本打包APP 排错指南
linux·服务器·开发语言·前端·flask
万邦科技Lafite4 小时前
1688图片搜索商品API接口(item_search_img)使用指南
java·前端·数据库·开放api·电商开放平台
yinuo5 小时前
网页也懂黑夜与白天:系统主题自动切换
前端
Coding_Doggy5 小时前
链盾shieldchain | 项目管理、DID操作、DID密钥更新消息定时提醒
java·服务器·前端
用户21411832636026 小时前
dify案例分享-国内首发!手把手教你用Dify调用Nano Banana2AI画图
前端
wa的一声哭了6 小时前
Webase部署Webase-Web在合约IDE页面一直转圈
linux·运维·服务器·前端·python·区块链·ssh