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.
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.
-
3
your html is buggy, it should be
<option value=''>content</option>
– Manoz Commented Feb 17, 2015 at 13:28 - 1 possible duplicate of Word wrap options in a select list – user2010925 Commented Feb 17, 2015 at 13:31
-
@Manoz It is just for example. I didn't forget the
value
part for the best of my knowledge. Please, if you have the answer, post it. – Raja Commented Feb 17, 2015 at 13:31 -
In the solution you found it says that it doesn't work on all the browsers and that you should try adding tags inside
<option></option>
item – Fourat Commented Feb 17, 2015 at 13:32 - 1 @Raj, Maybe the result is no. stackoverflow./questions/4258723/… – Manoz Commented Feb 17, 2015 at 13:46
2 Answers
Reset to default 2Please try jQuery-Selectric this plugin which possibly solve your issue.
Nope it is not possible with the standard option
tag. Try plugin menu's, there are tons. like this
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745040791a4607793.html
评论列表(0条)