<SELECT> 的 CSS 字体系列支持被删除在 Firefox 中? [英] CSS Font-Family Support Dropped for <SELECT> in Firefox?

查看:15
本文介绍了<SELECT> 的 CSS 字体系列支持被删除在 Firefox 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下 CSS 曾经适用于我测试过的所有浏览器.它甚至还有一个选项选择器来处理 Firefox.

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>

最新版本的 Firefox 不再正确应用字体系列样式.以前版本的 Firefox 以及我测试过的所有其他主要浏览器都将字体系列设置完全应用于选择和下拉列表中的项目 - 现在,它只应用于选择框本身,而不应用于下拉列表.

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.

Firefox 是否仍支持对下拉菜单进行字体系列更改?如果是,怎么办?

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

推荐答案

您可以使用以下方法为 Firefox 中的 select 和 option 元素设置字体:

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

select, option {
  font: -moz-pull-down-menu;
}

这篇关于&lt;SELECT&gt; 的 CSS 字体系列支持被删除在 Firefox 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆