所以,这是我的主页:
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
<title>TITLE</title>
<link href="/resources/css/bootstrap.css" rel="stylesheet" type="text/css"/>
<link href="/resources/css/myStyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<jsp:include page="parts/header.jsp"/>
<jsp:include page="parts/leftMenu.jsp"/>
<h2>WELCOME IN MY STORE!!!</h2>
<h2>WELCOME IN MY STORE!!!</h2>
...
<h2>WELCOME IN MY STORE!!!</h2>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/resources/js/bootstrap.min.js"></script>
</body>
</html>
正如你所看到的,我在这里包含了'leftMenu.jsp'文件,其中我动态地添加了一些我希望在左侧边栏上显示的类别。这是文件:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="nav nav-pills nav-stacked col-lg-1">
<c:forEach items="${categoryNames}" var="category">
<c:choose>
<c:when test="${category.getSubCategories().size()>'0'}">
<li><a data-toggle="collapse" href="#${category.getName().toLowerCase()}">${category.getName()}<span
class="caret"/></a></li>
<ul id="${category.getName().toLowerCase()}" class="collapse">
<c:forEach items="${category.getSubCategories()}" var="subCategory">
<li><a href="category/${category.getId()}/${subCategory.getId()}">${subCategory.getName()}</a>
</li>
</c:forEach>
</ul>
</c:when>
<c:otherwise>
<li><a href="category/${category.getId()}/0">${category.getName()}</a></li>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
我希望这个侧边栏占据整个可用高度,所以我尝试添加这个myStyle.css:
.nav {
height: 100%;
min-height: 100%;
}
但它并不是我想要的。
我该如何解决?