iframe设置的框架有空隙

iframe设置的框架有空隙

1、左边和左上角总有空隙

把 JSP 页面里的 <body> 改成:
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#000000">

或者

<body   style= "margin:0 ">


2、右边有空隙

解决办法,添加:scrolling= "no "

scrolling 默认为 auto。

示例:一个上部占据页面的整个上半部分,下半部分分为左右两边,左边是菜单,右边是菜单对应的展示页面,示例code 如下:

<frameset rows="50px,*" border="0">
  <frame id="top" src="top.jsp" scrolling="no"/>
  <frameset id="content" cols="190px,*" border="0">
      <frame id="left" src="left.jsp" name="leftFrame"/>
      <frame id="right" src="right.jsp" name="rightFrame" scrolling="auto" />
  </frameset>
</frameset>


你可能感兴趣的:(iframe设置的框架有空隙)