bootstarp和jquery的文件别忘了引入
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%--下拉菜单--%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <link href="${pageContext.request.contextPath}/static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"> <script src="${pageContext.request.contextPath}/static/common/jquery-2.2.3.min.js"></script> <script src="${pageContext.request.contextPath}/static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script> </head> <body> <div class="panel panel-default"> <%--这的class样式颜色 还有panel-primary,panel-info,panel-warning等自己尝试--%> <div class="panel-heading"> <%--标题栏--%> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> <%--内容栏--%> Panel content </div> </div> <div class="panel panel-success"> <div class="panel-heading"> <h3 class="panel-title">Panel title</h3> </div> <div class="panel-body"> Panel content </div> </div> </body> </html>