SSM开发之bootstrap整合

一、下载bootstrap

1.进入bootstrap官网,地址为https://www.bootcss.com,如下图
在这里插入图片描述
2.选择bootstrap进行下载,我这里下载的是bootstrap3,如下图
在这里插入图片描述

二、bootstrap使用

1.解压压缩包,粘到项目中,如下图

在这里插入图片描述

2.在jsp中引用bootstrap的js和css

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	String contextPath = request.getContextPath();
	String basePath = contextPath + "/CONFIG-INF";
%>

<!-- js import -->
<script src="<%=basePath%>/bootstrap/js/bootstrap.min.js"></script>

<!-- css import -->
<link href="<%=basePath%>/bootstrap/css/bootstrap.min.css" rel="stylesheet">

三、页面测试

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="../CONFIG-INF/common.jsp"></jsp:include>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录</title>
</head>
<body>

	<div class="container" style="width:400px; position: relative; top: 15%;">

      <div class="form-signin">
        <h2 class="form-signin-heading" style="text-align: center;">试卷分析系统</h2>
        <input type="text" id="username" class="form-control margincss" placeholder="用户名" required autofocus>
        <input type="password" id="password" class="form-control margincss" placeholder="密码" required>
        <div>
        	<input type="text" id="checkcode" class="form-control margincss" placeholder="验证码" style="display: inline; width: 50%;" required>
        	<div style="float: right;" class="margincss">
        		<img id="checkImg" alt="请稍等" style="width: 80px; height: 35px;">
        	</div>
        </div>
        <div class="checkbox">
          <label>
            <input type="checkbox" value="remember-me"> 记住我
          </label>
          <div style="float: right;">
          	<a>忘记密码</a>
          </div>
        </div>
        <button class="btn btn-lg btn-primary btn-block" type="button">登录</button>
      </div>

    </div>
</body>
</html>

注:这里的common.jsp引用了bootstrap的css和js
运行后的页面如下图:
在这里插入图片描述
…后续可能会有补充

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值