Web第一次作业

目录

题目

html代码

index

login

register

css代码

base

index

login

register

效果展示

index

login

register


题目

实现一个登录页面、实现一个注册页面;实现一个主页

  • 登录页面:`login.html`

  • 注册页面:`register.html`

  • 主页:`index.html`

要求如下:

  • 主页中,可以点击 **注册**或者**登录**能直接在新窗口跳转到对应的页面

  • 登录页面中,输入账号、密码可以点击登录-自动跳转到主页

  • 注册页面中,输入账号、密码、确认密码、昵称,点击注册,注册后自动跳转到登录页面

html代码

index

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>index</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/index.css">
</head>
<body>
    <div class="container">
        <h3>有位大能注意到了你,并向你发出邀请</h3>
        <div class="nav">
            <div class="login">
                <ul>
                    <li>
                        <a href="./login.html">进入宗门</a>
                        <a href="./login.html" target="_blank">好好修炼</a>
                    </li>
                </ul>
            </div>
            <div class="register">
                <ul>
                    <li>
                        <a href="./register.html">加入宗门</a>
                        <a href="./register.html" target="_blank">老祖的青睐</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>

login

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>login</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/login.css">
</head>
<body>
    <div class="container">
        <div class="body">
            <h3>请核实身份</h3>
            <p>
                <span>身份:</span>
                <input type="text" id="account" placeholder="此处填写账号">
            </p>
            <p>
                <span>密码:</span>
                <input type="password" id="passwd" placeholder="此处填写密码">
            </p>
        </div>
        <div class="nav">
            <div class="index">
                <ul>
                    <li>
                        <a href="./index.html">完成核实</a>
                        <a href="./index.html">老祖的认可</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>

register

html 复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>register</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/register.css">
</head>
<body>
    <div class="container">
        <div class="body">
            <h3>请登记身份</h3>
            <form action="">
                <p>
                    <span>身份:</span>
                    <input type="text" id="account" placeholder="此处填写账号">
                </p>
                <p>
                    <span>密码:</span>
                    <input type="password" id="passwd" placeholder="此处填写账号密码">
                </p>
                <p>
                    <span>确认密码:</span>
                    <input type="password" id="confirm_password" placeholder="确认密码">
                </p>
                <p>
                    <span>仙号:</span>
                    <input type="text" id="name" placeholder="此处填写昵称">
                </p>
                <p class="reset">
                    <span></span>
                    <input type="submit" value="提交" class="btn">
                    <input type="reset" value="重置" class="btn">
                </p>
            </form>
        </div>
        <div class="nav">
            <div class="login">
                <ul>
                    <li>
                        <a href="./login.html">完成登记</a>
                        <a href="./login.html">前往核实</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</body>
</html>

css代码

base

css 复制代码
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    list-style: none;
}

@font-face {
    font-family: ziti1;
    src: url(../font/字魂剑气手书.ttf);
}

@font-face {
    font-family: ziti2;
    src: url(../font/MD.ttf);
}

body  {
    background-color: #f5f5f5;
}

.container{
    /* border: 1px red solid; */
    margin: 20px auto;
    width: 1200px;
    height: 600px;
}

.nav {
    /* border: 1px blue solid; */
    margin: 20px auto;
    width: 1200px;
    height: 400px;
    display: flex;
}

ul {
    display: flex;
}

/* 导航 */
li {
    /* border: 1px black solid; */
    /* 对li与a定位 */
    position: relative;
    width: 200px;
    height: 200px;
    line-height: 200px;
    /* 3d实现 */
    /* transform: rotateX(-20deg) rotateY(30deg);
    transform: scale3d(1,1.1,1.1); */
    transform-style: preserve-3d;
    transition: all 0.5s;
}

li:hover {
    transform: rotateX(-90deg);
}

a {
    text-decoration: none;
    /* 定位 */
    position: absolute;

    display: block;
    width: 200px;
    height: 200px;
    border-radius: 8%;

    font-family: ziti1;
    font-size: 20px;
    text-align: center;
}

/*每个面都有独立的轴,互不影响 */
a:first-child {
    background-color: white;
    color: black;
    transform: translateZ(103px);
}

a:last-child {
    background-color: black;
    color: white;
    /* 调整旋转度数和a的轴距离 */
    transform: rotateX(90deg) translateZ(103px);
}

index

css 复制代码
.login {
    /* border: 1px rebeccapurple solid; */
    width: 300px;
    height: 100px;
    margin-top: 300px;
    margin-left: 300px;
    display: block;
}

.register {
    /* border: 1px black solid; */
    width: 300px;
    height: 100px;
    margin: 300px 0px 0px 200px;
    display: block;
}

h3 {
    font-size: 60px;
    text-align: center;
    padding-top: 50px;
    font-family: ziti2;
    color: rgb(215, 190, 160);
}

.container {
    background-image: url(../imges/下载4.jpg);
    background-repeat: no-repeat;
    background-size: cover;
}

li {
    margin-top: 20px;
    width: 300px;
    height: 100px;
    line-height: 100px;
}

a {
    width: 300px;
    height: 100px;
}

a:first-child {
    background-color: brown;
    transform: translateZ(50px);
}

a:last-child {
    background-color: rgb(215, 190, 160);
    transform: rotateX(90deg) translateZ(50px);
}

login

css 复制代码
.body {
    /* border: 1px black solid; */
    margin: 0 auto;
    width: 600px;
    height: 300px;
    margin-top: 30px;
    font-family: '楷体';
}

h3 {
    font-family: ziti2;
    font-size: 40px;
    color: aquamarine;
    text-align: center;
    margin: 16px 0;
}
                    
p {
    height: 80px;               
    margin-top: 30px;
}

span {
    display: inline-block;
    text-align: right;
    width: 85px;
    margin-left: 100px;
    margin-right: 20px;
    font-size: 25px;
}

input {
    height: 50px;
    color: #d9e2eb;
    vertical-align: middle;
    resize: none;
    border-radius: 5px;
}

.index {
    width: 500px;
    height: 200px;
    margin: 0 auto;
}

li {
    margin-top: 20px;
    width: 500px;
    height: 100px;
    line-height: 100px;
}

a {
    width: 500px;
    height: 100px;
}

a:first-child {
    transform: translateZ(50px);
}

a:last-child {
    background-color: #ace7fa;
    transform:rotateX(90deg) translateZ(50px);
}

.container {
    background-image: url(../imges/下载2.jpg);
    background-repeat: no-repeat;
    background-size: cover;
}

register

css 复制代码
.body {
    /* border: 1px black solid; */
    width: 800px;
    height: 400px;
    margin: 0 auto;
}

form {
    width: 60%;
    height: 300px;
    font-family: "楷体";
    font-weight: bold;
    margin: 20px auto;
    border-radius: 15%;
}

h3 {
    font-family: ziti2;
    font-size: 40px;
    text-align: center;
    margin: 16px 0;
}
                    
p {
    height: 50px;               
    margin-top: 16px;
}

span {
    display: inline-block;
    text-align: right;
    width: 100px;
    margin-left: 20px;
    margin-right: 20px;
    font-size: 20px;
}

input {
    height: 30px;
    color: #d9e2eb;
    vertical-align: middle;
    resize: none;
    border-radius: 5px;
}

.reset {
    height: 28px;
}

.btn {
    width: 100px;
    height: 28px;
    border-radius: 5px;
    color: black;
}

.login {
    width: 500px;
    height: 200px;
    margin: 0 auto;
}

li {
    margin-top: 20px;
    width: 500px;
    height: 100px;
    line-height: 100px;
}

a {
    width: 500px;
    height: 100px;
}

a:first-child {
    transform: translateZ(50px);
}

a:last-child {
    transform:rotateX(90deg) translateZ(50px);
}

.container {
    background-image: url(../imges/下载.jpg);
    background-repeat: no-repeat;
    background-size: cover;
}

效果展示

index

login

register

相关推荐
Σίσυφος190033 分钟前
halcon 条形码、二维码识别、opencv识别
前端·数据库
学代码的小前端35 分钟前
0基础学前端-----CSS DAY13
前端·css
css趣多多2 小时前
案例自定义tabBar
前端
姑苏洛言3 小时前
DeepSeek写微信转盘小程序需求文档,这不比产品经理强?
前端
林的快手3 小时前
CSS列表属性
前端·javascript·css·ajax·firefox·html5·safari
匹马夕阳4 小时前
ECharts极简入门
前端·信息可视化·echarts
API_technology4 小时前
电商API安全防护:JWT令牌与XSS防御实战
前端·安全·xss
yqcoder4 小时前
Express + MongoDB 实现在筛选时间段中用户名的模糊查询
java·前端·javascript
十八朵郁金香4 小时前
通俗易懂的DOM1级标准介绍
开发语言·前端·javascript
m0_528723816 小时前
HTML中,title和h1标签的区别是什么?
前端·html