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

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

相关推荐
excel几秒前
迭代器与生成器全面理解
前端
可口码农12 分钟前
MixOne:Electron Remote模块的现代化继任者
java·前端·electron
发如雪-ty18 分钟前
Bash常用操作总结
前端·chrome
冲!!29 分钟前
使用nvm查看/安装node版本
前端·node.js·node·nvm
LilyCoder1 小时前
HTML5二十四节气网站源码
前端·javascript·html·html5
Brookty1 小时前
【Java学习】锁、线程死锁、线程安全2
java·开发语言·学习·java-ee
Bruce_Liuxiaowei1 小时前
跨站脚本攻击(XSS)高级绕过技术与防御方案
前端·网络安全·xss
EF@蛐蛐堂1 小时前
【vue3】v-model 的 “新玩法“
前端·javascript·vue.js
两个月菜鸟2 小时前
vue+微信小程序 五角星
前端·vue.js·微信小程序
GISer_Jing3 小时前
React手撕组件和Hooks总结
前端·react.js·前端框架