黑马程序员技术交流社区

标题: frameset标签之疑问 [打印本页]

作者: 傅宇    时间: 2013-3-8 21:56
标题: frameset标签之疑问
  1. <html>
  2.   <head>
  3.     <title>Demo1.html</title>
  4.        
  5.     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  6.     <meta http-equiv="description" content="this is my page">
  7.     <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  8.    
  9.     <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  10.   </head>
  11.   <frameset cols="20%,*">
  12.   <frame name="left" />
  13.   <frame name="right" />
  14.   </frameset>
  15.   <body>
  16.     This is my HTML page. <br>
  17.   </body>
  18. </html>
复制代码
这段代码将整个页面分成左右两块,但是body标签里的代码就失效了,如何让body里的信息显示出来?
作者: a392085656    时间: 2013-3-9 00:47
frameset标签和body标签是不能同时使用的。官方有说明,http://www.w3school.com.cn/tags/tag_frameset.asp,有了frameset为啥还要用body呢,,
不过如果浏览器不支持frameset,可以在其中嵌套一个<noframes><body>This is my HTML page.</body></noframes>,这时body的内容就会显示了。




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2