PDA

View Full Version : Line break within <option> tag



squireglig
January 17th, 2006, 04:18 PM
Hey Guys,

I did a quick search on this, but didnt find anything. I apologize if it has been posted before.

I'm wondering whether the following is possible:

I have a select list in the following fashion


<select>
<option>This line is too long to display in one line on a small screen resolution</option>
</select>


Now I am wondering if I can break the line somehow, making the option span two lines instead. I've tried adding <br> and \n to the option's content, but neither work.

I'd appreciate any help you could offer.

ditt0
January 18th, 2006, 05:31 AM
You can't do that on a select box.
However you can recreate a select box with divs, css and a bit of javascript.Something like this:
http://www.thinkpinkstudio.com/projects/examples/select.html
Or even more similar to a select
http://www.thinkpinkstudio.com/projects/examples/select2.html