Reputation: 1327
Im trying to give a font-family to my options of my select menu but its not working.
Im trying with this code below, and it seems that works on google chrome, but on internet explorer Im having a different font-family.
Do you know how can I set a font-family to my options that works on chrome but also in internet explorer??
This is my html:
<div class="select_teams">
<select name="teams">
<option class="option">Select your team:</option>
<option class="option" value="1">ACM</option>
<option class="option" value="2">PSG</option>
<option class="option" value="2">RM</option>
</select>
</div>
This is my css:
.select_teams select{min-width:250px; padding:10px; border:3px solid #CCC; font-size:18px;}
.select_teams .option{transition:none; font-family:'bariol_regularregular';}
On chrome and mozilla Im getting this:
On internet explorer Im getting this:
Upvotes: 0
Views: 903
Reputation: 201538
Set the font on the select
element, not on the option
elements. Example:
.select_teams { font-family: 'bariol_regularregular'; }
The reason is that IE uses a uniform style for option
elements, based on the style of their parent select
element, instead of letting us style options individually. Cf. to Styling options in bold in Internet Explorer.
Upvotes: 1
Reputation: 2767
It's most likely down to how you are embedding the bariol_regularregular font.
You have no fallback font, so the browser will:
1 ) Try and use bariol_regularregular 2 ) Use the browser's default font
If you have embedded it correctly for Chrome but not IE, this is a possible solution: Safari and IE can't read TTF and EOT fonts
Using a similar font from Google Fonts may be a quicker fix - they do all that for you.
Upvotes: 1