Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Option Font-Family/Font-Face

Posted on 2004-04-13
11
Medium Priority
?
1,297 Views
Last Modified: 2013-12-03
Hi-
   How do you change the font-family/font-face of a simgle option? I tried putting this in the option tag:

style="font-family:Wingdings"

but that doesn't work. Neither does it work with font-face. I need this for one option, no the whole select menu. It is a multiple-select menu, if that matters.

-IceMetalPunk
0
Comment
Question by:IceMetalPunk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 6

Expert Comment

by:Andy
ID: 10819207
The font-family style does not apply to options only the whole menu.
0
 
LVL 31

Accepted Solution

by:
seanpowell earned 1000 total points
ID: 10819354
...that's all there is - the styling must be on the select element:
<select size="3" style="font-family:georgia;">

If you can handle a custom select box built from DHTML, then you have many more options:
http://webfx.eae.net/dhtml/select/jsGenerated.html
0
 
LVL 3

Expert Comment

by:azcn2503
ID: 10824958
I don't think it's possible to change the font family of a single option. However, I do know that the background colour can be changed, like so:
<option style="background-color:#f00;">Red</option>
<option style="background-color:#ff0;">Yellow</option>
Maybe it will be supported in future browsers.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10828218
The only options you have directly on the options are color and background-color.  The only thing you can with font is put the option in an optgroup, and then the label of the optgroup will be italics:

<option> one</option>
<option> two</option>
<optgroup label="more">
 <option> three</option>
</optgroup>
<option> etc...</option>


Cd&
0
 
LVL 6

Assisted Solution

by:Lord_McFly
Lord_McFly earned 1000 total points
ID: 10848872
I'm not sure exactly what it is you are trying to do - I'm guessing you have a list of characters in the multi-select list and need to apply a font to see how the characters change. As mentioned above its not possible to change each option individually.

What I done in my example is have an font list above the multi-select which when you select the font changes the font style of the multi-select list so you can see how those characters would look and once a font has been selected you'll be able to use the down arrow and basically scroll and view the effect it has on your multi-select list - if you get what I mean.

Cop and paste - have a quick look...

<html>
<head>
<title>Fonts</title>
<script language="JavaScript">
<!--
function ChangeFont(Object,FormItem)
      {
            document.getElementById(FormItem).style.fontFamily=Object.options[Object.selectedIndex].value;
      }
//-->
</script>
</head>
<body>
<form name="Tags" method="post" action="Tags.htm">
      <select name="f_0" onChange="ChangeFont(this,'f_1')" style="WIDTH: 100">
            <option value="">Select Font</option>
            <option value="Verdana">Verdana</option>
            <option value="Ariall">Ariall</option>
            <option value="WebDings">WebDings</option>
      </select><br>
      <select name="f_1" multiple style="WIDTH: 100">
            <option value="1">A</option>
            <option value="2">B</option>
            <option value="3">C</option>
      </select>
</form>
</body>
</html>
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10885478
Do you need any more assistance on this question?
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10933930
Describe a little more about what you are trying to do - maybe there is an alternative we could suggest.
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10950345
*** Misplaced comment deleted ***
0
 
LVL 6

Expert Comment

by:Lord_McFly
ID: 10950358
Sorry - wrong place :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question