Ich wende die Schriftfamilie im <select><option>
Tag an, aber es funktioniert keine Option, Leute
Mein Code:
<select name="t1_font" class="form-control" >
<option style="font-family: Font-familly path');">Font-family Name</option>
</select>
Mein echter Code, den ich verwende:
<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);?>
<style>
@font-face {
font-family: <?php echo $font_string?>;
src: url('<?php echo $font?>');
}
</style>
<?php $i++;
endforeach?>
<?php endif?>
<b>Family</b><br>
<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?>
</select>
</div>
Lösung des Problems
<select>
<optgroup style="font-family:arial">
<option>Arial</option>
</optgroup>
<optgroup style="font-family:verdana">
<option> veranda </option>
</optgroup>
<optgroup style="font-family:other">
<option>other</option>
</optgroup>
</selecct>
Keine Kommentare:
Kommentar veröffentlichen