下拉菜单项太宽的建议? [英] Recommendations for dropdown menu items that are too wide?

查看:88
本文介绍了下拉菜单项太宽的建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当下拉菜单面对的文字太宽而无法扩展菜单的宽度以适应时,我有什么样的选择?即它打破了页面布局,或者只是调整下拉以适应长条目时,看起来太难看。



截断?
截断加全部悬停文本?
不允许长的项目?



任何人遇到任何优雅的解决方案吗?

谢谢。

解决方案

我同意GordonB关于截断选项的建议。过长的选项很难阅读,正如你所提到的,它看起来很可怕。

然而,如果您的下拉列表是由用户输入填充的,我会限制其长度。可以用15个词来说,应该用5来表示......如果它不能,那么也许下拉不是你最好的选择。



例如,如果您的选择是研究论文及其作者的标题,您可以将它们缩写为几个关键词(弦乐理论与您[Brown 2008])。另一方面,如果选项本身仅相差几个字,并且被截断时会失去意义(例如花生酱和葡萄果冻三明治配胡萝卜条和豆浆以及花生酱和波森莓冻(如果用胡萝卜条和2%牛奶做成的沙司),或许你会更好地按顺序显示所有选项,并附上一个复选框或单选按钮。 你使用的是ASP.NET,基本上我用的是Repeater而不是DropDownList)

第二种方法也许可以让你包含你不想要的其他元素不能在下拉菜单中。看看这个亚马逊搜索结果页面的想法。


What kinds of options do I have when a dropdown menu is faced with text that is so wide that extending the menu's width to accommodate is not feasible? i.e. It breaks the page layout, or just looks too ugly if the dropdown is adjusted to fit the long item.

Truncation? Truncation plus full hover text? Don't allow items that long?

Anyone encountered any elegant solutions to this?

Thanks.

解决方案

I agree with GordonB regarding truncating the options. Excessively long options can be hard to read, and as you mentioned it looks horrible.

If your dropdown is populated from user input, however, I'd restrict the length. What can be said with 15 words should be said with 5 ... if it can't, then perhaps a dropdown isn't your best option.

For example, if your options are the titles of research papers and their authors, you can probably abbreviate them down to a few key words ("String Theory and You [Brown 2008]"). On the other hand, if the options themselves differ by only a few words and lose meaning if they are truncated (e.g. a list of options like "Peanut butter and grape jelly sandwich with carrot sticks and soy milk" and "Peanut butter and boysenberry jelly sandwith with carrot sticks and 2% milk") maybe you would be better served by displaying all the options sequentially, accompanied by a checkbox or radio button as appropriate.

(If you're using ASP.NET, basically I'm saying using a repeater instead of a DropDownList)

This second approach might also allow you to incorporate other elements that you wouldn't be able to in a dropdown. Take a look at this Amazon search result page for ideas.

这篇关于下拉菜单项太宽的建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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