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

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

相关推荐
峥嵘life1 天前
Android16 【CTS】CtsMediaCodecTestCases等一些列Media测试存在Failed项
android·linux·学习
会编程的土豆1 天前
新手前端小细节
前端·css·html·项目
广州华水科技1 天前
单北斗GNSS在桥梁形变监测中的应用与技术进展分析
前端
我讲个笑话你可别哭啊1 天前
鸿蒙ArkTS快速入门
前端·ts·arkts·鸿蒙·方舟开发框架
CherryLee_12101 天前
基于poplar-annotation前端插件封装文本标注组件及使用
前端·文本标注
特立独行的猫a1 天前
C++轻量级Web框架介绍与对比:Crow与httplib
开发语言·前端·c++·crow·httplib
周航宇JoeZhou1 天前
JB2-7-HTML
java·前端·容器·html·h5·标签·表单
代码小库1 天前
【课程作业必备】Web开发技术HTML静态网站模板 - 校园动漫社团主题完整源码
前端·html
EnglishJun1 天前
数据结构的学习(四)---栈和队列
数据结构·学习
珹洺1 天前
Bootstrap-HTML(二)深入探索容器,网格系统和排版
前端·css·bootstrap·html·dubbo