二次元的登录界面

简介: 二次元的登录界面

HTML部分


既然是制作登录界面我们可以使用表单元素,会比盒子更加简单一些,个人相信大家应该可以明白里头的啥意思吧!!!


这边就介绍一下CSS部分吧


<div class="shell">
        <div id="img-box">
            <img src="./a34a7810c48ee409750f92812023beb0-1.jpg" alt="">
        </div>
        <form action="" method="post">
            <div id="form-body">
                <div id="welcome-lines">
                    <div id="w-line-1">HI,xiaochao</div>
                    <div id="w-line-2">Welcome Back</div>
                </div>
                <div id="input-area">
                    <div class="f-inp">
                        <input type="text" placeholder="Email Address">
                    </div>
                    <div class="f-inp">
                        <input type="password" placeholder="Password">
                    </div>
                </div>
                <div id="submit-button-cvr">
                    <button type="submit" id="submit-button">LOGIN</button>
                </div>
                <div id="forgot-pass">
                    <a href="#">Forgot password?</a>
                </div>
            </div>
        </form>
    </div>


CSS部分


还是给我们先清除内外边距


然后这个ountline:none;的意思是鼠标点击文本框的时候,文本的边框焦点会被去除掉


还是设置一个背景颜色,这里我们使用的是渐变色:然后在需要让盒子来正中间,需要使用弹性布局


感觉下面都挺简单的,我就着重讲一下这个伪元素吧placeholder


placeholder 是HTML5 中新增的一个属性。placeholder可以用来描述输入字段预期值的简短的提示信息。提示信息会在用户输入值之前显示,一旦用户输入信息该提示就会自动消失。比如:我们在登录时需要输入用户名和密码,它会提示你什么地方输入用户名,什么地方输入密码,这个就是使用的placeholder属性。


* {
            padding: 0;
            margin: 0;
            outline: none;
        }
        body {
            background: linear-gradient(45deg, #fbda61, #ff5acd);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .shell,
        form {
            position: relative;
        }
        .shell {
            display: flex;
            justify-content: center;
        }
        form {
            width: 562px;
            height: 520px;
            background-color: #fff;
            box-shadow: 0px 15px 40px #b6354e;
            border-radius: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #img-box {
            width: 330px;
            height: 520px;
        }
        #img-box img {
            height: 100%;
      margin-left: -175px;
      border-radius: 20px;
        }
        #form-body {
            width: 320px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        #welcome-lines {
            width: 100%;
            text-align: center;
            line-height: 1;
        }
        #w-line-1 {
            color: #7f7f7f;
            font-size: 50px;
        }
        #w-line-2 {
            color: #9c9c9c;
            font-size: 30px;
            margin-top: 17px;
        }
        #input-area {
            width: 100%;
            margin-top: 40px;
        }
        .f-inp {
            padding: 13px 25px;
            border: 2px solid #6e6d6d;
            line-height: 1;
            border-radius: 20px;
            margin-bottom: 15px;
        }
        .f-inp input {
            width: 100%;
            font-size: 14px;
            padding: 0;
            margin: 0;
            border: 0;
        }
        .f-inp input::placeholder {
            color: #b9b9b9;
        }
        #submit-button-cvr {
            margin-top: 20px;
        }
        #submit-button {
            display: block;
            width: 100%;
            color: #fff;
            font-size: 14px;
            margin: 0;
            padding: 14px 40px;
            border: 0;
            background-color: #f5506e;
            border-radius: 25px;
            line-height: 1;
            cursor: pointer;
        }
        #forgot-pass {
            text-align: center;
            margin-top: 10px;
        }
        #forgot-pass a {
            color: #868686;
            font-size: 12px;
            text-decoration: none;
        }


接下来展示源码,素材图片就是封面哦


<!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>
    <style>
        * {
            padding: 0;
            margin: 0;
            outline: none;
        }
        body {
            background: linear-gradient(45deg, #fbda61, #ff5acd);
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        .shell,
        form {
            position: relative;
        }
        .shell {
            display: flex;
            justify-content: center;
        }
        form {
            width: 562px;
            height: 520px;
            background-color: #fff;
            box-shadow: 0px 15px 40px #b6354e;
            border-radius: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #img-box {
            width: 330px;
            height: 520px;
        }
        #img-box img {
            height: 100%;
      margin-left: -175px;
      border-radius: 20px;
        }
        #form-body {
            width: 320px;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }
        #welcome-lines {
            width: 100%;
            text-align: center;
            line-height: 1;
        }
        #w-line-1 {
            color: #7f7f7f;
            font-size: 50px;
        }
        #w-line-2 {
            color: #9c9c9c;
            font-size: 30px;
            margin-top: 17px;
        }
        #input-area {
            width: 100%;
            margin-top: 40px;
        }
        .f-inp {
            padding: 13px 25px;
            border: 2px solid #6e6d6d;
            line-height: 1;
            border-radius: 20px;
            margin-bottom: 15px;
        }
        .f-inp input {
            width: 100%;
            font-size: 14px;
            padding: 0;
            margin: 0;
            border: 0;
        }
        .f-inp input::placeholder {
            color: #b9b9b9;
        }
        #submit-button-cvr {
            margin-top: 20px;
        }
        #submit-button {
            display: block;
            width: 100%;
            color: #fff;
            font-size: 14px;
            margin: 0;
            padding: 14px 40px;
            border: 0;
            background-color: #f5506e;
            border-radius: 25px;
            line-height: 1;
            cursor: pointer;
        }
        #forgot-pass {
            text-align: center;
            margin-top: 10px;
        }
        #forgot-pass a {
            color: #868686;
            font-size: 12px;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <div class="shell">
        <div id="img-box">
            <img src="./a34a7810c48ee409750f92812023beb0-1.jpg" alt="">
        </div>
        <form action="" method="post">
            <div id="form-body">
                <div id="welcome-lines">
                    <div id="w-line-1">HI,xiaochao</div>
                    <div id="w-line-2">Welcome Back</div>
                </div>
                <div id="input-area">
                    <div class="f-inp">
                        <input type="text" placeholder="Email Address">
                    </div>
                    <div class="f-inp">
                        <input type="password" placeholder="Password">
                    </div>
                </div>
                <div id="submit-button-cvr">
                    <button type="submit" id="submit-button">LOGIN</button>
                </div>
                <div id="forgot-pass">
                    <a href="#">Forgot password?</a>
                </div>
            </div>
        </form>
    </div>
</body>
</html>


最后的效果是这样子的:



大家可以尝试敲一敲,这样一步步就会了解到这种类型的布局,然后自己在尝试几次就可以自己来写自己的专属登录界面然后后期通过js完善一下会更加完美哦!!

相关文章
|
存储 NoSQL 关系型数据库
|
8月前
|
人工智能 芯片
万相2.7,模型使用指南
万相2.7,拥有全面的创作控制力,将AI的能力从单一素材生成扩至创作全链路,从“演”迈向“导” 。
1118 11
万相2.7,模型使用指南
|
存储 数据可视化 数据挖掘
基于大数据的电影可视化、推荐与票房预测系统
本系统基于Python与Flask框架,结合Echarts等技术,实现电影数据的采集、存储与可视化展示。通过对票房、评分、评论等数据的分析,生成图表与词云,帮助用户直观理解电影市场趋势,支持决策制定与观影推荐,提升电影行业的数据分析能力与用户体验。
|
API 定位技术 Python
高德商家手机电话号码采集工具,可采集地址坐标手机号码提取软件
这是一套基于高德地图API的商家信息采集解决方案,提供核心代码与功能实现。通过高德Place API,合法合规地批量采集商家基础信息
GitHub 上的超级 Python 游戏项目,不容错过!
今天分享一个超级牛的 GitHub 项目,是一个专门的基于 Pygame 开发小游戏的项目。该项目就开源在 G 站上,目前已经获得了 2.6K 的 Star 和 1.5K 的 Fork,可以说是超级牛掰了!
GitHub 上的超级 Python 游戏项目,不容错过!
|
数据采集 数据可视化 算法
【优秀python案例】基于Python的豆瓣电影TOP250爬虫与可视化设计与实现
本文设计并实现了一个基于Python的豆瓣电影TOP250爬虫与可视化系统,通过获取电影评分、评论并应用词云和饼图等可视化技术,为用户提供了电影评价的直观展示和深入分析。
3441 3
【优秀python案例】基于Python的豆瓣电影TOP250爬虫与可视化设计与实现
|
关系型数据库 MySQL 数据库
【Mac os系统】安装MySQL数据库
本文详细介绍了在Mac OS系统上安装MySQL数据库的步骤,包括下载、安装、配置环境变量、启动服务、授权设置以及解决常见问题,并提供了一些常用的MySQL命令。
2449 0
【Mac os系统】安装MySQL数据库
|
机器学习/深度学习 边缘计算 文字识别
基于YOLOv8的汽车车牌位置实时检测项目【完整源码数据集+PyQt5界面+完整训练流程+开箱即用!】
本项目基于YOLOv8与PyQt5,打造开箱即用的汽车车牌位置实时检测系统。包含完整源码、2万张带标注数据集、预训练权重及详细教程,支持图片、视频、摄像头等多种输入方式。通过直观GUI实现一键检测,适合快速部署与二次开发。未来可扩展OCR模块、多目标识别等功能,助力智能交通管理。附带训练代码与流程文档,助你轻松上手深度学习车牌检测任务。
基于YOLOv8的汽车车牌位置实时检测项目【完整源码数据集+PyQt5界面+完整训练流程+开箱即用!】
|
数据采集 机器学习/深度学习 Web App开发
Python爬虫如何应对贝壳网的IP封禁与人机验证?
Python爬虫如何应对贝壳网的IP封禁与人机验证?
|
JavaScript 应用服务中间件 Linux
宝塔面板部署Vue项目、服务端Node___配置域名
本文介绍了如何使用宝塔面板在阿里云服务器上部署Vue项目和Node服务端项目,并配置域名。文章详细解释了安装宝塔面板、上传项目文件、使用pm2启动Node项目、Vue项目打包上传、以及通过Nginx配置域名和反向代理的步骤。
6602 2
宝塔面板部署Vue项目、服务端Node___配置域名