你如何向div添加滚动条? [英] How do you add a scroll bar to a div?

查看:23
本文介绍了你如何向div添加滚动条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个显示一些结果的弹出窗口,我想显示一个滚动条,因为结果被截断了(我不希望弹出窗口太长).

I have a popup that displays some results, and I want a scroll bar to be display since the results are being cutt off (and I don't want the popup to be too long).

推荐答案

您需要将 style="overflow-y:scroll;" 添加到 div 标签中.(这将强制垂直滚动条).

You need to add style="overflow-y:scroll;" to the div tag. (This will force a scrollbar on the vertical).

如果你只需要一个滚动条,只需执行 overflow-y:auto;

If you only want a scrollbar when needed, just do overflow-y:auto;

这篇关于你如何向div添加滚动条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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