appearance 是否已废除??

    span {
        appearance: button;
        -moz-appearance: button;
        -webkit-appearance: button;



我本机试验 chrome90/firefox87 均无效。



阅读 1.1k
1 个回答
根据 chrome 的 features 记录

-webkit-appearance keywords for arbitrary elements

Changes -webkit-appearance keywords to work only with specific element types.  If a keyword is applied to a non-supported element, the element has the default appearance.

Can I use : appearance

根据信息,chrome90 / firefox87 确认都是支持的

MDN 档上写的 all element
但是根据 w3c 文档的描述,并不是针对所有元素

W3C 的文档

While the way most elements in a document look can be fully controlled by CSS, widgets are typically rendered by UAs using native UI controls of the host operating system, which can neither be replicated nor styled using CSS.

The term widget in this specification denotes elements that can have native appearance, meaning that they are rendered like analogous native widgets or controls of the host operating system or platform, or with a look and feel not otherwise expressible in CSS. It is up to the host language (e.g., HTML [HTML]) to define which elements can have native appearance.

  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进