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

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

相关推荐
Nan_Shu_6145 小时前
学习:ES6(2)
前端·学习·es6
河铃旅鹿6 小时前
Android开发-java版:Framgent
android·java·笔记·学习
自动化代码美学8 小时前
【Python3.13】官网学习之控制流
开发语言·windows·python·学习
命运之光8 小时前
【最新】ChromeDriver最新版本下载安装教程,ChromeDriver版本与Chrome不匹配问题
前端·chrome
AA陈超9 小时前
ASC学习笔记0020:用于定义角色或Actor的默认属性值
c++·笔记·学习·ue5·虚幻引擎
星离~10 小时前
Vue响应式原理详解:从零实现一个迷你Vue
前端·javascript·vue.js
梦65010 小时前
React 简介
前端·react.js·前端框架
一只小阿乐10 小时前
react 中的判断显示
前端·javascript·vue.js·react.js·react
光影少年10 小时前
useMemo 和 React.memo区别
前端·react.js·前端框架
小沐°10 小时前
React-页码组件
前端·javascript·react.js