直播平台制作,html+css复刻登录输入框

发布时间 2023-04-07 14:14:26作者: 云豹科技-苏凌霄

直播平台制作,html+css复刻登录输入框

 

<!DOCTYPE html>
<html>
<!--
    *Material文本框
    *作者:程序员阿诺斯
    *时间:2023-3-5 0:50
-->
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Material文本框</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }
    html,body {
        width: 100%;
        height: 100%;
        position: relative;
    }
    .form-item {
        width: 300px;
        height: 40px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-bottom: 1px solid #bbb7b7;
    }
    #userName {
        width: 100%;
        height: 100%;
        border: none;
        outline: none;
        color: #dbdcdf;
    }
    .bar {
        display: block;
        margin: 0 auto;
        width: 0;
        height: 2px;
       
        transition: 0.4s ease;
    }
    label {
        font-size: 26px;
        position: absolute;
        top: -7px;
        left: 0;
        transition: 0.4s ease;
    }
    .form-item input:focus~.bar {
        width: 100%;
    }
    .form-item input:valid~label {
        color: #5264ae;
        transform: translateY(-30px);
    }
    .form-item input:focus~label {
        color: #5264ae;
        transform: translateY(-30px);
    }
</style>
<body>
    <div class="form-item">
        <input type="text" required id="userName">
        <span class="bar"></span>
        <label for="userName"> User Name</label>
    </div>
</body>
</html>

以上就是直播平台制作,html+css复刻登录输入框, 更多内容欢迎关注之后的文章