欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

JSP作业2 - 利用html实现简单的用户登录注册界面

程序员文章站 2022-05-06 11:28:53
...

实验要求:

自己拟定一个Web应用系统,设计其启动页面和用户登录注册页面。

具体要求:

设计系统启动页面,使用CSS完成页面中的格式化设计简单格式化即可。

用户登录页面

页面中至少包括用户登录表单,有用户注册的链接方式。

登录表单的提交可以暂时空缺

用户注册页面

页面中至少包括用户注册表单,有用户登录的链接方式。

注册表单的提交可以暂时空缺

JSP作业2 - 利用html实现简单的用户登录注册界面
JSP作业2 - 利用html实现简单的用户登录注册界面
JSP作业2 - 利用html实现简单的用户登录注册界面

代码

index.html

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>jsp作业</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="./">jsp作业</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="login.html">登录</a></li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="jumbotron">
        <h1>Hello, world!</h1>
        <p>这是一个jsp作业</p>
    </div>
</div>
</body>
</html>

login.html

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>登录</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="./">jsp作业</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="login.html">登录</a></li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="row">
        <div class="col-md-4">

        </div>
        <div class="col-md-4">
            <form class="form-signin" target="submitFrame" method="post">
                <h2 class="form-signin-heading">登录到jsp作业</h2>
                <label for="inputEmail">Email</label>
                <input type="email" id="inputEmail" class="form-control" placeholder="请输入Email" required autofocus><br>
                <label for="inputPassword">密码</label>
                <input type="password" id="inputPassword" class="form-control" placeholder="请输入密码" required>
                <div class="checkbox">
                    <label>
                        <input type="checkbox" value="remember-me" checked="checked"> 记住密码
                    </label>
                </div>
                <button type="submit" class="btn btn-primary" id="btn-login">登录</button>
                <a href="reg.html" class="btn btn-default">注册</a>
            </form>
            <iframe style="display: none;" name="submitFrame" src="about:blank"></iframe>
        </div>
        <div class="col-md-4">
        </div>
    </div>
    <script src="js/jquery.min.js"></script>
</body>
</html>

注册页面reg.html

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>注册</title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="./">jsp作业</a>
        </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="login.html">登录</a></li>
            </ul>
        </div>
    </div>
</nav>
<div class="container">
    <div class="row">
        <div class="col-md-4">
        </div>
        <div class="col-md-4">

            <form class="form-signin" target="submitFrame" method="post">
                <h2 class="form-signin-heading">注册到jsp作业</h2>
                <div id="info">

                </div>
                <label for="inputEmail">Email</label>
                <input type="email" id="inputEmail" class="form-control" placeholder="请输入Email" required autofocus><br>
                <label for="inputPassword">密码</label>
                <input type="password" id="inputPassword" class="form-control" placeholder="请输入密码" required maxLength="16"><br>
                <label for="inputPassword">重复密码</label>
                <input type="password" id="inputPassword2" class="form-control" placeholder="请再次输入密码" required maxLength="16"><br>
                <button type="submit" class="btn btn-primary" id="btn-reg">注册</button>
                <a href="login.html" class="btn btn-default" id="btn-reg">返回登录</a>
            </form>
            <iframe style="display: none;" name="submitFrame" src="about:blank"></iframe>
        </div>
        <div class="col-md-4">
        </div>
    </div>
    <script src="js/jquery.min.js"></script>
</body>
</html>

css使用bootstrap.min.css