如何将右边框应用于包含 <c:forEach
的 div阻止?
在下面的 jSTL 代码中,我试图在 <c:forEach
的右侧显示一个边框。堵塞 。不显示边框。 css 似乎只适用于一个 div(没有 jSTL 代码):
<div class="verticalLineRight">
myborder
</div>
.verticalLineRight {
border-right:solid #6E6A6B;
border-width:100px;
}
fiddle :http://jsfiddle.net/F23s9/1/
但是当我将 div 包裹在 <c:forEach
周围时阻止不显示边框:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Tag Example</title>
</head>
<body>
<div style="border-right:solid #6E6A6B; border-width:10px; ">
<c:forEach var="i" begin="1" end="5">
Item <c:out value="${i}"/><p>
</c:forEach>
</div>
</body>
</html>
最佳答案
试试这个
<div style="border-right:1px solid #6E6A6B; border-width:10px; ">
<c:forEach var="i" begin="1" end="5">
<p>Item <c:out value="${i}"/><p>
</c:forEach>
</div>
关于css - 边框未应用于jsp中jSTL内的div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15156383/