2014-11-08 91 views
0

我已經爲我的網站創建了一個使用css的html佈局。此佈局包含在我的jsp文件中,使用該操作。 我的問題是,當我嘗試將內容放入佈局的內容部分時,它會在佈局外移動,而不是按需要移動。這是我第一次使用jsp,所以任何幫助都很棒!下面將內容插入到包含在jsp中的html佈局中

是我的代碼:

.header{ 
 
background-color: crimson; 
 
height: 15%; 
 
} 
 

 
.logo{ 
 
padding-left: 25px; 
 
padding-right: 25px; 
 
padding-top: 20px; 
 
width: 21%; 
 
color: black; 
 
font-family: "Trebuchet MS",sans-serif; 
 
font-weight: bold; 
 
font-size: 80px; 
 
border: ridge; 
 
border-color: black; 
 
border-width: thick; 
 
} 
 

 
.footer{ 
 
height: 2%; 
 
text-align: center; 
 
} 
 

 
.body{ 
 
padding-top: 15%; 
 
height: 400px; 
 
} 
 

 
.page{ 
 
\t background-color: gainsboro; 
 
}
<html> 
 
<head> 
 
<link rel="stylesheet" href="layoutstyle.css"> 
 
</head> 
 
<div class="page"> 
 
<div class="header"> 
 
<div class="logo"> 
 
Bookie<small style="font-size: 30px">.com</small> 
 
</div> 
 
</div> 
 
<div> 
 

 
</div> 
 
<div class="footer"> 
 
copyright @abc 
 
</div> 
 
</div> 
 
</html>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
 
    pageEncoding="ISO-8859-1"%> 
 
    <jsp:include page="layout.html"/> 
 
<!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=ISO-8859-1"> 
 
<title>LogIn</title> 
 
</head> 
 

 
<div class="body"> 
 
hi 
 
</div> 
 
</html>

請幫助!

+0

如果您標記哪個文件是哪個 – 2015-07-04 00:36:37

回答

0

在這些文件中沒有任何JSP代碼。 JSP是封裝在<%%>標籤中的Java代碼。這聽起來像你正在轉移內容的問題可能是一個CSS問題。