页面嵌入后,如何让其嵌入到指定div的位置

Love_云宝儿 Love_云宝儿 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
是这样的,我使用<jsp:include>嵌入6个相同的页面,分别放在6个div中,实际显示的时候,6个div完全在左侧排列,跟实际div的位置不一样,我想让他嵌入实际的div中,该怎么做?
源页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'sixVedio.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
#screen{
position:relative;
top:0;
left:0;
width:1920px;
height:1080px;
background:#fff;
}

#screen1{
position:absolute;
margin-top:0;
margin-left:0;
width:200px;
height:200px;
background:#ff0000;
}
#screen2{
position:absolute;
margin-top:500px;
margin-left:0;
width:200px;
height:200px;
background:#00ff00;
}
#screen3{
position:absolute;
margin-top:0;
margin-left:600px;
width:200px;
height:200px;
background:#0000ff;
}
#screen4{
position:absolute;
margin-top:500px;
margin-left:600px;
width:200px;
height:200px;
background:#ffff00;
}
#screen5{
position:absolute;
margin-top:0;
margin-left:1200px;
width:200px;
height:200px;
background:#ff00ff;
}
#screen6{
position:absolute;
margin-top:500px;
margin-left:1200px;
width:200px;
height:200px;
background:#00ffff;
}

</style>
</head>

<body>
<div class="screen">
<div id="screen1"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v1"/></jsp:include></div>
<div id="screen2"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v2"/></jsp:include></div>
<div id="screen3"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v3"/></jsp:include></div>
<div id="screen4"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v4"/></jsp:include></div>
<div id="screen5"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v5"/></jsp:include></div>
<div id="screen6"><jsp:include page="DPVedio.jsp" flush="true"><jsp:param name="vedioId" value="v6"/></jsp:include></div>

</div>
</body>
</html>


被嵌入页面:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String vedioId=request.getParameter("vedioId");
%>

<!DOCTYPE html>
<html>
<head>
<style>
#obj{width:100%;height:100%;}
</style>

</script>
</head>

<body>
<div id="obj"></div>
</body>
</html>


被嵌入页面js挺多的,但没有涉及到样式,我就给删掉了

请问,如何才能实现我想要的效果?
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
Love_云宝儿
CSS 61,116 成员 60,701 内容