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

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

相关推荐
tb_first1 分钟前
万字超详细苍穹外卖学习笔记3
java·jvm·笔记·学习·spring·tomcat·maven
coldstarry3 分钟前
sheng的学习笔记-AI-adaboost(Adaptive Boosting)
人工智能·笔记·学习
qq_12498707533 分钟前
基于html的书城阅读器系统的设计与实现(源码+论文+部署+安装)
前端·vue.js·spring boot·后端·mysql·信息可视化·html
liliangcsdn8 分钟前
探索对比学习的改进-经典对比学习 vs 分组对比学习
学习
red_redemption15 分钟前
自由学习记录(114)
学习
a177988771221 分钟前
小程序为什么 Upload 外层使用 display: flex 时会造成组件样式混乱
css·html·css3
一个懒人懒人23 分钟前
mysql2连接池配置与优化
前端·mysql
saoys29 分钟前
Opencv 学习笔记:图像旋转 + 模板匹配(解决旋转目标定位问题)
笔记·opencv·学习
PorkCanteen30 分钟前
Cursor使用-从问题到解决方案(以及一些通用rules)
前端·ai·ai编程
£漫步 云端彡32 分钟前
Golang学习历程【第十二篇 错误处理(error)】
开发语言·学习·golang