HTML选择选项多行值 [英] HTML select option multiline value
问题描述
我在我的HTML页面中选择选择
和选项
标签。
< select>
< option value =1> 1< / option>
< option value =2> 2< / option>
< option value =3> 3< / option>
< option value =与流行的观点相反,Lorem Ipsum不是简单的随机文本,它起源于公元前45年的一段古典拉丁文献,使其超过2000年的历史,Richard McClintock。>与流行的观点相反,Lorem Ipsum不仅仅是随机文本。它源于公元前45年的一段古典拉丁文学,已有2000多年历史。 Richard McClintock。< / option>
< / select>
我的最后一个选项有一个从数据库检索的大文本,它比选择框大。 p>
是否可以使这个< option>
值双线或多行由 CSS
或 Javascript
类似于下面?
我发现<一个href =https://stackoverflow.com/questions/4746824/can-you-have-multiple-lines-in-an-option-element>这,但我不明白。
更新:
有人在回答这里。但是这个链接不起作用。
我可以通过 sql查询
来限制我的字符数。但这不是解决方案。 解决方案
请尝试 jQuery-Selectric 这个插件可能解决您的问题。
I have select
and option
tags in my HTML page.
<select>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock.">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock.</option>
</select>
My last option has a big text retrieving from database and it is bigger than the select box.
Is it possible to make this <option>
value double line or multi line by CSS
or Javascript
like below ?
I found this but I could not understand.
UPDATE:
Somebody marked my question as already answered here. But this link is not working.
I can limit my character count by sql query
. But this is not the solution.
Please try jQuery-Selectric this plugin which possibly solve your issue.
这篇关于HTML选择选项多行值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!