我已经使用 css 为我的网站创建了一个 html 布局。此布局使用操作包含在我的 jsp 文件中。 我的问题是,当我尝试将内容放入布局的内容部分时,它会移到布局之外,而不是按要求移到布局上。这是我第一次使用 jsp,所以任何帮助都会很棒!
下面是我的代码:
.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{
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>
请帮忙!!
最佳答案
这些文件中没有任何 JSP 代码。 JSP 是包含在 <%
中的 Java 代码和 %>
标签。听起来您遇到的内容移动问题可能是 CSS 问题。
关于html - 将内容插入到jsp中包含的html布局中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26814761/