...

View Full Version : font-family for dropdown list



htmlster
02-14-2011, 01:58 AM
Hi,

I would like to change the font-family for the entries (Test1, Test2) in the dropdown list to arial as below:

<select>
<option >Test1</option>
<option >Test2</option>
</select>

I modified it as:

<select>
<option style="font-family: arial">Test1</option>
<option style="font-family: arial">Test2</option>
</select>

But this doesn't work. Can you please let me know how i can resolve this.

Thanks.

Nile
02-14-2011, 01:59 AM
Try doing it with CSS:


<style type="text/css">
select option { font-family: arial; }
</style>

Excavator
02-14-2011, 02:36 AM
Hello htmlster,

But this doesn't work. Can you please let me know how i can resolve this.

I think it should work though, which makes me thing you have something overriding it. Do you have something in your CSS specifying a different font with !important on it?

Give us a link to the test site to look for it.

htmlster
02-14-2011, 06:18 PM
Exactly. I have another select which is overiding my class.

Now i'm able to see the font-family properly.

i have .select {font-family: verdana}; changed this and it worked. Thanks for your suggestion.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum