html - 将内容插入到jsp中包含的html布局中

标签 html css jsp

我已经使用 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/

相关文章:

html - 如何将 em 标签重新设置为粗体而不是斜体

java - 如何仅在 JSP 中使用网络摄像头(不使用 Servlet)捕获图像并将其保存到 MS SQL Server 中

javascript - 克隆内联表单字段并附加到父容器

html - 将联系表格添加到静态网站

html - bootstrap-select 选项列表仅与底层组件一样长

javascript - 仅在一个部分实现整页js效果

java - tomcat漏洞讨论

java - 如何从另一个jsp调用div

javascript - 使用 jQuery 将 CSS 添加到正文中的 head 标签

javascript - 一次更改 div 内容两次