iframe的用法

iframe 元素会创建包含另外一个文档的内联框架(即行内框架)。

属性:

创建内联框架(JSP页面)

 

 1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
 2 <%
 3 String path = request.getContextPath();
 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 5 %>
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <base href="<%=basePath%>">
11     
12     <title>My JSP 'index.jsp' starting page</title>
13     
14     <meta http-equiv="pragma" content="no-cache">
15     <meta http-equiv="cache-control" content="no-cache">
16     <meta http-equiv="expires" content="0">    
17     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
18     <meta http-equiv="description" content="This is my page">
19 
20     <link rel="stylesheet" type="text/css" href="styles.css">
21 
22   </head>
23   <body>
24     <iframe src="http://www.cnblogs.com/sunyunh/archive/2012/08/18/2645989.html" width="700" height="610"> </iframe>  <!--创建内联框架并设置长和宽  -->
25   </body>
26 </html>

显示结果:

 

posted @ 2016-11-28 09:48  小雨滴答  阅读(231)  评论(0编辑  收藏  举报