如何使用垂直滚动条制作下拉菜单? [英] how to make a drop down menu with a vertical scroll bar?

查看:100
本文介绍了如何使用垂直滚动条制作下拉菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我需要在下拉菜单中放置一个垂直滚动条,起初它只会出现大小= 1,但是当我们下拉它时应该有一个垂直滚动条,
可以帮助我,如果您使用html-dropdownbox,Natrium建议您可以将属性设置为size(大小)属性,选择标记,以指定要显示的行数。因此,如果 - 在他的示例中 - 您将大小设置为3,则会将下拉框设置为3行高,并附加一个滚动条以向下滚动到其余3个项目。



如果你的意思是用CSS表示,假设你在div标签中显示你的下拉菜单,你可以使用类似的东西:

 < div style =height:200px; overflow-y:scroll> ...< / div> 

这给你一个绝对高度的div。如果div的内容太大,会自动显示垂直滚动条。


hi i need to put a vertical scroll bar in the drop down menu such that at first it will appear only size=1 but when we drop down it should have a vertical scroll bar , can anybody help me , i would really appreciate any help

解决方案

If you use the html-dropdownbox, Natrium suggested, you can set the attribute "size" of the select tag, to specify how many lines you want to show. So if - in his example - you set size to 3, you'd have the dropdownbox 3 lines high and a scrollbar attached to scroll down to the remaining 3 items.

If you mean something with CSS, say you display your dropdown-menu in a div-tag, you could use something like that:

<div style="height:200px; overflow-y:scroll">...</div>

This gives you a div with an absolute height. If the content of the div gets too big, a vertical scroll bar is displayed automatically.

这篇关于如何使用垂直滚动条制作下拉菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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