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;
    }

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

相关推荐
-木槿昔年-5 分钟前
【米尔-安路MYD-YM90X创意秀】飞龙派学习和PS串口实践
学习·fpga开发
前端不太难16 分钟前
如何给 RN 项目设计「不会失控」的导航分层模型
前端·javascript·架构
用户40993225021219 分钟前
Vue3中v-show如何通过CSS修改display属性控制条件显示?与v-if的应用场景该如何区分?
前端·javascript·vue.js
不会聊天真君64727 分钟前
CSS3(Web前端开发笔记第二期)
前端·笔记·css3
discode32 分钟前
【开源项目技术分享】@host-navs 站导,一个简洁高效的网站链接导航工具站
前端
车载测试工程师32 分钟前
CAPL学习-SOME/IP交互层-符号数据库访问类函数
学习·tcp/ip·以太网·capl·canoe
PieroPC35 分钟前
Nicegui 3.4.0 可以缩小组件之间的间距 label botton input textarea
前端
写代码的皮筏艇37 分钟前
数组 forEach
前端·javascript