<div></div>主要是用来设置涵盖一个区块为主,所谓的区块是包含一行以上的数据,所以在<div></div>的开始之前与结束后,浏览都会自动换行,所以夹在<div></div>间的数据,自然会与其前后文隔开而自成一区快

主要设置页面的布局
定义方位,布局
 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
 3 <%
 4 String path = request.getContextPath();
 5 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 6 %>
 7 
 8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 9 <html>
10   <head>
11     <base href="<%=basePath%>">
12     <title><tiles:insertAttribute name="title"/></title>
13     <link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
14     <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.2.min.js"></script>
15 </head>
16 <body>
17     
18     <tiles:insertAttribute name="header"  />
19     <div style="position: absolute;margin-top: 88px">
20         <tiles:insertAttribute name="menu"  />
21     </div>
22     <div style="position: absolute;margin-left:187px; margin-top: 88px">
23         <tiles:insertAttribute name="content" />
24     </div>
25     
26 </body>
27 </html>

 

posted on 2016-08-15 14:33  Sharpest  阅读(2708)  评论(0编辑  收藏  举报