您可以使用包含以下内容的 css 将左侧列设为 div:
overflow: scroll
如果有任何溢出,将出现一个滚动条并且该 div 将是可滚动的。您需要将所有内容包装在一个固定宽度的 div 中,这样您就不会得到水平滚动条。
编辑:一个例子。
<html>
<head>
<style type="text/css">
#example{
overflow: scroll;
height: 200px;
width: 100px;
border: 1px solid red;
color: #FFF;
background-color: #000;
}
</style>
</head>
<body>
<div id="example">Hello, World!</div>
</body>
</html>
现在,如果你替换“Hello, World!” 和:
Line One<br />
Line Two<br />
Line Three<br />
Line Four<br />
Line Five<br />
Line Six<br />
Line Seven<br />
Line Eight<br />
Line Nine<br />
Line Ten<br />
一旦文本太长而无法填充 div,您应该立即获得滚动操作。