使用javaweb技术,一步步实现网站

本文介绍了使用JavaWeb技术构建一个军训管理系统的登录页面,包括HTML和CSS代码示例,展示了如何设计美观且功能性的登录界面,以及Maven框架的使用。
摘要由CSDN通过智能技术生成


前言

使用javaweb技术做网站,分为几个部分,该小节是找到所需要的html网页框架(或者自己写,建议网上扣一个,然后自己改一下),本项目是自己写的军训管理系统。感兴趣的小伙伴可以关注点赞一下,持续更新。


一、美观,实用登录(html、css)页面

1、项目的框架结构

该项目使用maven框架,项目的框架结构如下图所示

页面代码位于webapp下面:

2、登录(login.html)页面

页面展示:

1、页面html代码:

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

<head>
    <meta charset="UTF-8">
    <title>login</title>
    <link href="css/login.css" rel="stylesheet">
</head>

<body>
<div id="loginDiv" style="height: 350px">
    <form action="/Jx/loginServlet" method="post" id="form">
        <h1 id="loginMsg">登录</h1>
        <div id="errorMsg">用户名或密码不正确</div>
        <p>用户名:<input id="name" name="name" type="text"></p>

        <p>密码:<input id="password" name="password" type="password"></p>
<!--        <p>单位: <select id="position" name="position" style="width: 200px; height: 30px;">-->
        <p>是否记住:<input id="remember" name="remember" type="checkbox"></p>
        <div id="subDiv">
            <input type="submit" class="button1" id="login" value="登录">
            <input type="reset" class="button2" value="重置">&nbsp;&nbsp;&nbsp;
            <a href="register.html">没有账号?</a>
        </div>
        <script>
            document.getElementById("login").addEventListener("click", function() {
                window.location.href = "http://localhost:63342/jx-demo/src/main/webapp/seek.html";});
        </script>
    </form>
</div>

</body>
</html>

2、css代码:

* {
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: url(../imgs/Desert1.jpg) no-repeat;
    background-size: 100% 100%;
    -moz-background-size: 100% 100%;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#loginDiv {
    width: 37%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 380px;
    background-color: rgba(75, 81, 95, 0.3);
    box-shadow: 7px 7px 17px rgba(52, 56, 66, 0.5);
    border-radius: 5px;
}

#name_trip {
    margin-left: 50px;
    color: red;
}

p {
    margin-top: 30px;
    /*margin-left: 10px;*/
    color: azure;
}


#remember{
    margin-left: 15px;
    border-radius: 5px;
    border-style: hidden;
    background-color: rgba(216, 191, 216, 0.5);
    outline: none;
    /*padding-left: 10px;*/
    height: 20px;
    width: 20px;
}
#name{
    width: 200px;
    margin-left: 15px;
    border-radius: 5px;
    /*border-style: hidden;*/
    height: 30px;
    background-color: rgba(216, 191, 216, 0.5);
    outline: none;
    color: #f0edf3;
    text-align: left;
    border-color: #d3dce6;
    /*padding-left: 10px;*/
}
#password{
    width: 202px;
    margin-left: 30px;
    border-radius: 5px;
    /*border-style: hidden;*/
    height: 30px;
    background-color: rgba(216, 191, 216, 0.5);
    outline: none;
    color: #f0edf3;
    /*padding-left: 10px;*/
    border-color: #d3dce6;

}
.button1,.button2 {
    border-color: cornsilk;
    background-color: rgba(100, 149, 237, .7);
    color: aliceblue;
    /*border-style: hidden;*/
    border-radius: 5px;
    width: 100px;
    height: 31px;
    font-size: 16px;

}
.button1{
    margin-left: 30px;
}
.button2{
    margin-left: 40px;
}
#subDiv {
    text-align: center;
    margin-top: 6px;
}
#loginMsg{
    text-align: center;
    color: aliceblue;
}
#errorMsg{
    text-align: center;
    color:red;
}

该css中使用到的背景图片(Desert1.jpg)

  • 10
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值