Html – How to apply font family in HTML tag of select option


I am applying Font family in <select><option> tag but it is not working any option guys

My code :

<select name="t1_font" class="form-control" >
   <option style="font-family: Font-familly path');">Font-family Name</option>

My real code that I am using :

      <div class="col-sm-4">
  <?php $fonts=glob(FONT_URL.'*'); //print_r($fonts); ?>
  <?php if (!empty($fonts)): $i=0;?>
  <?php foreach ($fonts as $font):
    $font_arr= explode('/',$font); $font_string =substr($font_arr[3], 0, -4);?>
    @font-face {
       font-family: <?php echo $font_string ?>;
       src: url('<?php echo $font ?>');
    <?php $i++;
    endforeach ?>
     <?php endif ?>
    <select name="t1_font" class="form-control" >
    <?php if (!empty($fonts)): ?>
      <?php foreach ($fonts as $font): $font_arr= explode('/',$font); $font_string =substr($font_arr[3], 0, -4); ?>
          <option style="font-family: <?php echo $font_string ?>;src: url('<?php echo base_url($font) ?>');" value="<?php echo $font_arr[3] ?>" <?php if(!empty($default_data_param->text1))
          {if($font_arr[3]== $default_data_param->text1_font_file){ echo'selected';}}?> ><?php echo ucfirst($font_string) ?></option>
      <?php endforeach ?>
    <?php endif ?>

Best Solution


  <optgroup style="font-family:arial">

  <optgroup style="font-family:verdana">
     <option> veranda </option>

  <optgroup style="font-family:other">