android按钮扁平,纯CSS3 Android样式按钮点击波特效

css-ripple-effect是一款使用纯CSS3制作的炫酷扁平风格按钮点击波特效。该效果是仿照Android系统的Material design风格点击波来制作的。

使用方法

在页面中引入ripple.css文件。

HTML结构

要为一个元素制作点击波特效,只需要为它添加ripple class类即可。

Primary

CSS样式

你可以通过ripple.css文件或ripple.less文件来修改点击波效果的样式。

.ripple {

position: relative;

overflow: hidden;

&:after {

content: "";

background: rgba(255,255,255,0.3);

display: block;

position: absolute;

border-radius: 50%;

padding-top: 240%;

padding-left: 240%;

margin-top: -120%;

margin-left: -120%;

opacity: 0;

transition: all 1s;

}

&:active:after {

padding-top: 0;

padding-left: 0;

margin-top: 0;

margin-left: 0;

opacity: 1;

transition: 0s;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一些常见的按钮选择的 CSS 样式: 1. 扁平按钮样式: ```css button { background-color: #4CAF50; color: white; border: none; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 5px; } button:hover { background-color: #3e8e41; } ``` 2. 3D 按钮样式: ```css button { background-color: #4CAF50; color: white; border: none; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 5px; box-shadow: 0 5px #357a38; } button:hover { background-color: #3e8e41; box-shadow: 0 3px #357a38; transform: translateY(2px); } ``` 3. 玻璃按钮样式: ```css button { background-color: transparent; color: #fff; border: 2px solid #fff; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 5px; position: relative; overflow: hidden; } button:hover { background-color: #fff; color: #000; border-color: #000; } button:before { content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 0; height: 0; border-radius: 50%; background-color: rgba(255, 255, 255, 0.3); transition: width 0.2s ease-out, height 0.2s ease-out; } button:hover:before { width: 500px; height: 500px; } ``` 4. 渐变按钮样式: ```css button { background: linear-gradient(to bottom, #e64c3c, #c0392b); color: #fff; border: none; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; border-radius: 5px; transition: background 0.3s ease-out; } button:hover { background: linear-gradient(to bottom, #c0392b, #e64c3c); } ``` 以上是一些常见的按钮选择的 CSS 样式,可以根据需要进行修改和调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值