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

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

相关推荐
('-')11 小时前
《从根上理解MySQL是怎样运行的》第十章学习笔记
笔记·学习·mysql
hd51cc11 小时前
MFC学习笔记 对话框
笔记·学习·mfc
likuolei11 小时前
XSL-FO 软件
java·开发语言·前端·数据库
正一品程序员11 小时前
vue项目引入GoogleMap API进行网格区域圈选
前端·javascript·vue.js
j***894611 小时前
spring-boot-starter和spring-boot-starter-web的关联
前端
star_111211 小时前
Jenkins+nginx部署前端vue项目
前端·vue.js·jenkins
Radan小哥11 小时前
Docker学习笔记—day0010
笔记·学习·docker
im_AMBER11 小时前
Canvas架构手记 05 鼠标事件监听 | 原生事件封装 | ctx 结构化对象
前端·笔记·学习·架构
JIngJaneIL11 小时前
农产品电商|基于SprinBoot+vue的农产品电商系统(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·毕设·农产品电商系统
老神在在00111 小时前
Mybatis01
后端·学习·spring·java-ee·mybatis