如何允许由一个页面的边2 DIV侧的含量为独立地向下滚动或向上不使用帧? [英] How to allow the content of 2 DIV side by side of a page to be scroll down or up independently without using frames?

查看:149
本文介绍了如何允许由一个页面的边2 DIV侧的含量为独立地向下滚动或向上不使用帧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写在ASP经典的网页使用的框架包含2帧。虽然左帧用于显示菜单,右帧显示的页面内容。

I have an page written in ASP classic that uses frameset containing 2 frames. While the left frame serve to display the menu, the right frame display the page content.

的方式在页面的作品,用户可以自主的向下或向上滚动帧中的任意一个内容。

The way the page works, user can independently scroll down or up content of either one of the frames.

我怎么能只使用HTML和CSS复制相同的功能?

How can I reproduce the same functionality using only HTML and CSS?

<div id="menu-container">
  //menu goes here...
</div>
<div id="main-content">
  //main content here...
</div>

感谢您的帮助。

推荐答案

给每一个固定的高度像500像素;

Give each a fixed height like 500px;

然后溢出-y属性设置为auto或滚动,使滚动条

Then set the overflow-y property to auto or scroll to enable the scrollbar

溢出-Y:汽车;

在这里是工作提琴:

https://jsfiddle.net/pablo_tavarez/dobza7gv/1/

这篇关于如何允许由一个页面的边2 DIV侧的含量为独立地向下滚动或向上不使用帧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆