Forum Moderators: open

Message Too Old, No Replies

Is it possible to change the text size in a Select

Looking at Displaying the drop down

         

IanTurner

6:54 pm on Dec 5, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Is it possible to change the font size in a drop down box?

evisions

12:19 am on Dec 6, 2002 (gmt 0)

10+ Year Member



yes you have to do it using style sheets. Here is the code you need:

<select name="keywords" style="height:13px; line-height:9px; font-size: 9px;">
<option>item 1</option>
<option>item 2</option>
<option>item 3</option>
<option>item 4</option>
</select>

SethCall

4:11 am on Dec 6, 2002 (gmt 0)

10+ Year Member



Alrighty. Here is a more difficult question (I think)

I tried to change the font type of each option once. with no success, obviously :(

so, has anyone ever tried/gotten that to work?

pageoneresults

4:22 am on Dec 6, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I believe you should be able to assign a class to each of the <option> tags. Something like this...

option.blue{color:#000080;background:transparent}

<option class="blue">Blue Option</option>

Quick Tip:

Use the <optgroup> tag to add structure to your selects...

<optgroup label="Option Group Name">
<option>Option</option>
</optgroup>