.box {
   height: 500px;
   overflow-y: auto;
   border: 1px solid red;
}

具体有用的代码是:

height: 500px;
overflow-y: auto;



使用JavaScript实现,给Div添加内容,并且滚动到最下方:

function onSend() {
	var now = new Date();
	var div = document.getElementById('box');
	div.innerHTML = div.innerHTML + 'time_' + now.getTime() + '<br />';
	div.scrollTop = div.scrollHeight;
}