Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Font-Family Support Dropped for <SELECT> in Firefox?

Tags:

The following CSS used to work in all browsers that I have tested. It even has an option selector to handle Firefox.

select,
option {
  font-family: "Lucida Console", Monaco, monospace;
}
<select>
  <option>PN-2345&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The first element&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hardware</option>
  <option>Pn-1332-CFG&nbsp;&nbsp;Second thing&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Powdercoat</option>
</select>

The newest versions of Firefox no longer properly apply font family styles. Former versions of Firefox, and every other major browser I've tested, fully apply the font family settings both to the select and to the items in the dropdown - now, it only gets applied to the select box itself, but NOT the dropdown.

Select box with partial support for the font (here shown in Impact). Note the items are not showing the proper font.

Does Firefox still support font-family changes to dropdowns? If so, how?

like image 447
wedstrom Avatar asked Oct 05 '16 22:10

wedstrom


People also ask

How do I change my font-family in Firefox?

Select Options from the menu. On the Firefox settings page, scroll down to the Language and Appearance section. Select the Advanced button to open the Fonts window. To override fonts that may have been set by a website, untick the box labelled Allow pages to choose their own fonts, instead of your selections above.

How can I add fonts to Firefox?

Open Firefox and click the three-bar Settings icon. Select "Options." 2. In the "Content" tab you can make changes to font and languages.


1 Answers

You can set the font for both the select and option elements in Firefox using:

select, option {
  font: -moz-pull-down-menu;
}
like image 166
cschaefer Avatar answered Sep 20 '22 09:09

cschaefer