在下拉列表中包裹长文本? [英] Wrap long-text in drop-down list?

查看:86
本文介绍了在下拉列表中包裹长文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net页面的下拉列表中有清晰的长文本。它违反UI边界并超出UI的已分配区域。



有没有我可以使用CSS或javascript包装[不修剪]?

解决方案

更长的答案:是的。



您可以使用不是默认元素,但使用JavaScript和CSS自己。您的自定义droplist元素应该包含几个div(或其他HTML元素)作为droplist项目。当您将固定宽度设置为droplist的单元格时,文本将包装在内部。



一个示例在这里(只是从google中的查询中挑选了第一个链接:JavaScript下拉菜单)。

I have legibly long text in a drop-down list on my asp.net page. it violates the UI boundary and goes beyond the allocated region of UI.

Is there anyway I can wrap [not trim] it using CSS or javascript ? I must display the entire string, no matter how long it is.

解决方案

Longer answer: yes.

You can use not default element, but make your own with JavaScript and CSS. Your custom droplist element should contain few divs (or other HTML elements) as droplist items. When you'll set fixed width to droplist's cell, text will wrap inside.

One example is here (just picked up the 1st link from query in google: "JavaScript dropdown").

这篇关于在下拉列表中包裹长文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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