分享总大小的Div(不是百分比)

时间:2009-12-25 17:11:43

标签: css html

是否可以像下面的帧一样连接div的大小? 我在谈论*中的rows="*, 16",它占用剩余的空间。

<frameset frameborder="0"  rows="70, *, 30">
   <frame name="toolbar" src="toolbar.html" marginwidth="8px" marginheight="8px" />

   <frameset id="lineNumFrameset" frameborder="0" cols="50, *">
      <frameset rows="*, 16">
      <frame id="other_frame" name="lineNum" src="lineNum.html" marginwidth="8px" marginheight="8px" align="top" />
      </frameset>

      <frame name="editor" src="editor.html" marginwidth="8px" marginheight="8px" />
   </frameset>

   <frame name="statusbar" src="statusbar.html" marginwidth="8px" marginheight="8px" />
</frameset>

谢谢。

2 个答案:

答案 0 :(得分:2)

看起来你想要一个流畅的三列布局。

使用margin和float会起作用。将您的第一个div浮动到左侧,并将其设置为您希望最左侧列宽的宽度。将您的第二个div放在右侧并设置其宽度。然后你的第三个div不会浮动,但是你将它的左边距设置为左列的宽度,右边距设置为右列的宽度。

如果您的任何一列的高度高于中间div,则会有一些问题需要解决,但这可以通过创建一个包含浮动的div来解决。

编辑:添加示例:

http://css.maxdesign.com.au/selectutorial/steps/step22.htm

答案 1 :(得分:0)

我对此问题的解决方案是使用onresize事件,并使用JavaScript在相关高度CSS属性上设置视口(document.documentElement.clientHeight)。