Forum Moderators: open

Message Too Old, No Replies

Is it possible to insert a line break in a pulldown list item?

         

timware

3:33 am on Dec 21, 2003 (gmt 0)

10+ Year Member



Subject line says it all. I have a pulldown list where some of the items are really long and, before I just create two <options> to accommodate the two lines, I'm just checking to see if anyone knows of a more elegant solution.

Thanks.

Tim

tedster

7:54 am on Dec 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The question comes up a lot - and no one has had a solution that I've seen except for the clunky "two options" work around that you mention.

timware

3:14 pm on Dec 21, 2003 (gmt 0)

10+ Year Member



Well, since I posted this I figured out how to do it, without having to figure out a line break. I just created a class called "pulldown":

.pulldown {

background-color: #ccc;
color: #333;
font-size: 9pt;
width: 150px;
}

I just put the class in the <select> tag;

<select name="whatever" class="pulldown">

It's the width attribute that's the key. It keeps the pulldown to 150 px wide. When the user clicks on the pulldown it expands to accommodate the long lines, but when it's not open it's a tidy 150px wide.

Thanks for the reply anyway. Hopefully, this will help others, as well.

Tim