Jump to content

CSS font styling for select option


Don E
 Share

Recommended Posts

Hey everyone, The following seems to only work in FireFox but not in other browsers; the font doesn't get styled in others except FireFox. What would be the recommended way or technique to make it work in most/all browsers?

<select name="fontType" >  <option selected="selected"></option>  <option style="font-family:Arial;" value="arial">Arial</option>   <option style="font-family:'Comic Sans MS';" value="comic">Comic-Sans</option>   <option style="font-family:DejaVu-Sans;" value="dejavu">DejaVu-Sans</option>   <option style="font-family:Courier;" value="cour">Courier</option>   <option style="font-family:Georgia;" value="georgia">Georgia</option>   <option style="font-family:Gothic" value="gothic">Gothic</option>   <option style="font-family:Helvetica;" value="helvetica">Helvetica</option>   <option style="font-family:Impact;" value="impact">Impact</option>   <option style="font-family:Tahoma;" value="tahoma">Tahoma</option>   <option style="font-family:'Times New Roman';" value="times">Times New Roman</option>   <option style="font-family:'Trebuchet MS';" value="trebuc">Trebuchet</option>   <option style="font-family:Verdana;" value="verdana">Verdana</option></select>

Thanks.

Link to comment
Share on other sites

That not going to work for other browsers, the only way you can get this to work is not use a select dropdown, but a unordered list, very much like a menu, where you can style pretty much how you want, then use javscript to gather the html on clicking and add the value to an hidden input element.

  • Like 1
Link to comment
Share on other sites

That not going to work for other browsers, the only way you can get this to work is not use a select dropdown, but a unordered list, very much like a menu, where you can style pretty much how you want, then use javscript to gather the html on clicking and add the value to an hidden input element.
Thanks for the input. I'll def consider this.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...