12.15
图书信息管理(使用layui模板)
图书信息主页面的代码
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <title>后台布局</title> <link rel="stylesheet" href="layui/css/layui.css" > </head> <body class="layui-layout-body"> <div class="layui-layout layui-layout-admin"> <div class="layui-header"> <div class="layui-logo">图书管理系统</div> <ul class="layui-nav layui-layout-right"> <li class="layui-nav-item"><a href="shouye.jsp" target="frame">回到首页</a></li> <li class="layui-nav-item"> 用户:<%= session.getAttribute("account")%> </li> <li class="layui-nav-item"><a href="login.jsp">退出</a></li> </ul> </div> <div class="layui-side layui-bg-black"> <div class="layui-side-scroll"> <!-- 左侧导航区域(可配合layui已有的垂直导航) --> <ul class="layui-nav layui-nav-tree" lay-filter="test"> <li class="layui-nav-item"> <a href="add.jsp" target="frame">增加图书信息</a> </li> <li class="layui-nav-item"> <a href="update.jsp" target="frame">图书信息修改</a> </li> <li class="layui-nav-item"> <a href="delete.jsp" target="frame">图书信息删除</a> </li> <li class="layui-nav-item"> <a href="Servlet?method=show" target="frame">图书信息查看</a> </li> <li class="layui-nav-item layui-nav-itemed"> <a class="" href="javascript:;">图书分类</a> <dl class="layui-nav-child"> <dd><a href="Servlet?method=jisuanji" target="frame">计算机科学</a></dd> <dd><a href="Servlet?method=ziran" target="frame">自然科学</a></dd> <dd><a href="Servlet?method=renwen" target="frame">人文科学</a></dd> <dd><a href="Servlet?method=tianwen" target="frame">天文地理</a></dd> </dl> </li> </ul> </div> </div> <div class="layui-body"> <!-- 内容主体区域 --> <div style="padding: 0px" > <iframe id="righFrame" name="frame" width="100%" height="1000px" scrolling="no" style="border:1px solid #CCC;"></iframe> </div> </div> <div class="layui-footer"> <!-- 底部固定区域 --> 底部边界 </div> </div> <script src="layui/layui.all.js"></script> <script> //JavaScript代码区域 layui.use('element', function(){ var element = layui.element; }); </script> </body> </html>
感觉这一部分设计的layui的东西最多了。
再看看增加图书信息页面的代码
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Insert title here</title> <!-- <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css"> --> <script type="text/javascript" language="javascript" src="js/jquery-1.7.2.min.js" ></script> <style type="text/css"> /* .container { width: 1000px; height: 700px; /* position: relative; */ margin: 0 auto; /* background: url("images/background.png") no-repeat center/cover; */ background: #66CDAA; } */ .logtip { padding-top: 5px; padding-left: 0px; /* padding-bottom: 5px; */ border-bottom: 2px solid #009688; text-align: left; } label { color: #2E8B57; font-size:120%; float: left; width: 150px; margin-top: 2px; margin-right: 3px; } .form-group { margin-left: 40px; margin-top: 20px; } .form-control { width: 200px; flex: 4; height: 30px; outline: none; border-radius: 5px; border: 1px solid #999999; /* box-sizing: border-box;//盒子模型,怪异IE盒子模型,width=content+border*2+padding*2 */ padding-left: 10px; } .btnbag{ margin-top: 20px; margin-bottom: 20px; /* text-align: center; */ } .button { width: 100px; height: 40px; background-color: #009688; color: white; border: none; border-radius: 5px; font-size: 22px; } .option{ /*用div的样式代替select的样式*/ width: 140px; height: 40px; /*border-radius: 5px;*/ /*盒子阴影修饰作用,自己随意*/ box-shadow: 0 0 5px #ccc; border: 1px solid #cccccc; position: relative; font-size: 18px; border-radius: 5px; }, </style> <body> <% Object message = request.getAttribute("message"); if(message!=null && !"".equals(message)){ %> <script type="text/javascript"> alert("<%=request.getAttribute("message")%>"); </script> <%} %> <!-- <div class="container"> --> <div class="login"> <h2 class="logtip">添加</h2> <form action="Servlet?method=add" method="post" onsubmit="return check()"> <div class="form-group"> <label for="author">作者</label> <input type="text" class="form-control" id="author" name="author" > </div> <div class="form-group"> <label for="ISBN">ISBN号</label> <input type="text" class="form-control" id="ISBN" name="ISBN" > </div> <div class="form-group"> <label for="banname">出版社</label> <input type="text" class="form-control" id="banname" name="banname" > </div> <div class="form-group"> <label for="category">图书分类</label> <select name="category" id="category" class="option"> <option selected="selected" value="">请选择</option> <option value="计算机科学">计算机科学</option> <option value="自然科学">自然科学</option> <option value="人文科学">人文科学</option> <option value="天文地理">天文地理</option> </select> </div> <div class="form-group"> <label for="introduction">图书简介</label> <input type="text" class="form-control" id="introduction" name="introduction" > </div> <div class="form-group"> <label for="evaluate">图书评价</label> <input type="text" class="form-control" id="evaluate" name="evaluate"> </div> <div class="form-group"> <button type="submit" class="button">确认</button> </div> </form> </div> <!-- </div> --> </body> </html>
盒子模型都是直接 采用网上的,所以这一部分还可以吧!