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

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

问题描述

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

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.

无论如何我可以使用 CSS 或 javascript 包裹 [而不是修剪] 它吗?无论多长,我都必须显示整个字符串.

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.

推荐答案

更长的答案:是的.

您可以不使用默认元素,而是使用 JavaScript 和 CSS 制作自己的元素.您的自定义下拉列表元素应包含少量 div(或其他 HTML 元素)作为下拉列表项.当您将下拉列表的单元格设置为固定宽度时,文本将在里面换行.

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.

一个例子在这里(刚刚从谷歌查询中获取了第一个链接: JavaScript 下拉菜单").

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

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

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