1、css3 动态button展示学习

效果图:

1、首先创建html代码:

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>关注我</button>
</body>
</html>

2、展示css3代码:

css 复制代码
button{
        width: 120px;
        height: 38px;
        background-color: transparent;
        color: #000;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        font-size: 20px;
        font-weight: 600;
        font-family: Arial, Helvetica, sans-serif;
        box-sizing: border-box;
        position: relative;
        transition: all 0.6s ease-in-out;
    }
    button:after{
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 1px;
        height: inherit;
        background-color: #333;
        z-index: -1;
        transition: all 0.6s ease-in-out;
    }
    button:hover{
        color: aliceblue;
        cursor: pointer;
    }
    button:hover:after{
        width: 100%;
        border-radius: 6px;
    }

本人也是学习阶段,希望能够一起学习,高手请留余地勿喷。

相关推荐
二月龙8 分钟前
移动端适配必杀技:Viewport与响应式布局全解
前端
大萝卜呼呼8 分钟前
Next.js第十七课 - 部署
前端·typescript·next.js
只会写Bug25 分钟前
后台管理项目中关于新增、编辑弹框使用的另一种展示形式
前端·vue.js
weixin1997010801632 分钟前
《废旧物资商品详情页前端性能优化实战》
前端·性能优化
用户527096487449035 分钟前
Vite 开发代理里的 `ws` 是什么,什么时候该开
前端
冰水不凉36 分钟前
robot_localization实现imu和odom融合
前端·slam
M ? A1 小时前
Vue v-bind 转 React:VuReact 怎么处理?
前端·javascript·vue.js·经验分享·react.js·面试·vureact
军军君011 小时前
数字孪生监控大屏实战模板:政务服务大数据
前端·javascript·vue.js·typescript·前端框架·echarts·less
05Nuyoah1 小时前
CSS文本和字体属性,列表属性
javascript·css·css3
热爱生活的五柒1 小时前
度量学习-Radar Signal Deinterleaving Using Transformer Encoder and HDBSCAN 论文解析
深度学习·学习·transformer