Forum Moderators: open
Not sure I'm in the right part of the forum.
I need to change the individual options in a drop down box to different fonts. I run a greetings card company and wish to offer my customers the option of different fonts and want the options to reflect the font choice. I need to be able to change or add fonts at will and there may be different choices for different cards on the same page, so I need to be able to add coding to each dropdown box. Is this possible?
Thanks in advance!
you could apply a font with an inline style using thr style attribute of the option tag, or you could assign a unique id to each option tag with the id attribute and use css to assign a font to each id.
CSS
<style type="text/css">
.arial{ font-family:Arial; background-color:#3399CC}
.Verdana{ font-family:Verdana; background-color:#66CC99}
.cgothic{ font-family:Century Gothic; background-color:#FFFF99}
.trebuchet{ font-family:Trebuchet MS; background-color:#CC99FF}
</style>
HTML
<select name="txtSelect">
<option value="1" class="arial">Arial
<option value="2" class="verdana">Verdana
<option value="3" class="cgothic">Century Gothic
<option value="3" class="trebuchet">Trebuchet MS
</select>
Try it yourself, you will notice that this only partially works with Internet Explorer.