【前端】名片制作和注册登录界面(附源码)

发布于:2024-06-16 ⋅ 阅读:(22) ⋅ 点赞:(0)

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">

<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>Document</title>
    <link rel="stylesheet" href="样式.css">
</head>

<body>
    <div class="user-card">
        <div class="user-card-head">
            <div class="change">
                <a href="#">...</a>
            </div>
        </div>
        <div class="user-card-body">
            <div class="left">
                <div class="photo">
                    <img src="花瓣树叶背景.png" alt="GG">
                </div>
            </div>
            <div class="right">
                <div class="right-text">
                    <div class="username">
                        CodeRanger
                        <span style="color: rgb(8, 218, 237); font-weight: bold;"></span>
                    </div>
                    <div class="reuptation">
                        <span class="gai">
                            <span>19</span>
                            <span>关注</span>
                        </span>
                        <span class="gai">
                            <span>1W</span>
                            <span>粉丝</span>
                        </span>
                        <span class="gai">
                            <span>87W</span>
                            <span>点赞</span>
                        </span>
                    </div>
                </div>
                <div class="right-button">
                    <button>关注</button>
                    <button>私聊</button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
.user-card {
    width: 300px;
    height: 200px;
    background-color: rgb(244, 241, 238);
    box-shadow: 2px 2px 5px black;
    margin: 50% auto;
}

.user-card-head {
    background-image: url('花瓣树叶背景.png');
    background-size: cover;
    width: 100%;
    height: 80px;
}


.user-card-body {
    height: calc(100%-70px);
    width: 100%;
    box-sizing: border-box;
    padding-top: 12px;
    padding-left: 8px;
}


.left {
    width: 70px;
    height: 100%;
    float: left;
}

.right {
    width: calc(100% - 70px);
    height: 100%;
    float: left;
}

.photo img {
    width: 65px;
    height: 65px;
    border-radius: 50%;

}

.change>a {
    font-size: 25px;
    margin-top: 1%;
    margin-left: 80%;
    text-decoration: none;
    color: white;
}

.change:hover {
    transform: scale(1.1);
    transition: 200ms;
}

.right-text {
    width: 100%;
    height: 70%;
}

.username {
    font-size: 16px;
    color: rgb(246, 8, 119);
    font-weight: bold;
}

.username:hover {
    transform: scale(1.1);
    transition: 200ms;
}


.gai {
    margin-right: 20px;
}


.gai>span:nth-child(1) {
    font-size: 10px;
    color: #222222;
}

.gai>span:nth-child(2) {
    font-size: 5px;
    color: #9499a0;
}

.reuptation {
    padding-top: 10px;
}

.right-button>button {
    width: 70px;
    height: 30px;
    border: none;
    border-radius: 5px;
    margin-right: 5px;
}

.right-button>button:nth-child(1) {
    background-color: #00b5e5;
    color: white;
}

.right-button>button:nth-child(2) {
    border: #ccd0d7 solid 2px;
    color: #6d757a;
}

.right-button>button:nth-child(2):hover {
    border-color: #00b5e5;
    color: #00b5e5;
    transition: 200ms;
}

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<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>登陆页面</title>
        <!-- author xjt -->
</head>
<body>
    <div class="login">
        <h2>登陆\注册</h2>
        <div class="login_form">
            <span>账号:</span>
            <input type="text" placeholder="请输入账号">
            <br>
            <span>密码:</span>
            <input type="password" placeholder="请输入密码">
        </div>
        <div class="btn">
            <button class="login_btn" onclick="login()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</button>
        </div>
    </div>
</body>
<script>
    function login(){
        console.log('登录按钮点击了');
    }
</script>
<style>
    body{
        padding: 0;
        margin: 0;
        height: 100vh;
        display: flex;
        justify-content: center;
        background-image: linear-gradient(#a18cd1 0%, #fbc2eb 100%);
        background-size: cover;
        flex: 1;
        align-items: center;
    }
    .login{
        text-align: center;
        margin: 0 auto;
        width: 600px;
        height: 520px;
        background-color: rgba(87, 86, 86, 0.2);
        border-radius: 25px;
        box-shadow: 5px 2px 35px -7px #ff9a9e;
    }
    .login h2{
        margin-top: 40px;
        color: aliceblue;
        font-weight: 100;
    }
    .login_form{
        padding: 20px;
    }
    .login_form span{
        color: rgb(131, 220, 255);
        font-size: 18px;
        font-weight: 100;
    }
    .login_form input{
        background-color: transparent;
        width: 320px;
        padding: 2px;
        text-indent: 2px;
        color: white;
        font-size: 20px;
        height: 45px;
        margin: 30px 30px 30px 5px;
        outline: none;
        border: 0;
        border-bottom: 1px solid rgb(131, 220, 255);
    }
    input::placeholder{
        color: #fbc2eb;
        font-weight: 100;
        font-size: 18px;
        font-style: italic;
    }
    .login_btn{
        background-color: rgba(255, 255, 255, 0.582);
        border: 1px solid rgb(190, 225, 255);
        padding: 10px;
        width: 240px;
        height: 60px;
        border-radius: 30px;
        font-size: 30px;
        color: rgb(100, 183, 255);
        font-weight: 100;       
        margin-top: 15px;
    }
    .login_btn:hover{
        box-shadow: 2px 2px 15px 2px rgb(190, 225, 255);
        background-color: transparent;
        color: white;
        /* 选择动画 */
        animation: login_mation 0.5s;
    }

    /* 定义动画 */
    @keyframes login_mation
    {
        from {
            background-color: rgba(255, 255, 255, 0.582);
            box-shadow: 0px 0px 15px 2px rgb(190, 225, 255);
        }
        to {
            background-color: transparent;
            color: white;
            box-shadow: 2px 2px 15px 2px rgb(190, 225, 255);
        }
    }
</style>

</html>



网站公告

今日签到

点亮在社区的每一天
去签到