Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

appearance

这篇翻译不完整。请帮忙从英语翻译这篇文章

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

appearance 表示是否让一个元素(HTML标签)使用操作系统原生控件的样式。

例如,我们无法通过CSS样式设置 <input type='checkbox'> 的背景,但是通过
设置appearance:none; 即可"删除" 默认背景样式。此时我们就可以为该元素添加背景样式了。

 

input[type='checkbox']{

    appearance:none;

    /** 添加你的背景样式代码 **/ 

}

初始值auto
适用元素all elements
是否是继承属性
适用媒体all
计算值As specified
Animation typediscrete
正规顺序per grammar

Syntax

appearance: auto;
appearance: none;

Values

<appearance> is one of the keywords in the table below.

Value Demo Description
auto  

默认情况下,浏览器引擎可以使用主机操作系统的本地控件进行表单控件的渲染。当自动计算时,浏览器引擎仍然需要设置下列属性:

  • all
  • bottom
  • clear
  • cursor
  • direction
  • display
  • float
  • left
  • margin
  • position
  • right
  • top
  • unicode-bidi
  • visibility 
  • z-index
none  

表单控件的样式不再被强制显示与操作系统本地控件一样 。元素的样式可以通过CSSS控制。除了表单控件以外的其他替换元素都不会受到影响。

Formal syntax

auto | none

Examples

.exampleone {
  appearance: auto;
}

Specifications

Specification Status Comment
CSS Basic User Interface Module Level 4
appearance
Editor's Draft Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 52.0-webkit [1]     39  
Feature Android Android Webview Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile Chrome for Android
Basic support 未实现 52.0-webkit [1]     39   52.0-webkit [1]

[1] Applies to the <meter> element only.

文档标签和贡献者

 此页面的贡献者: ngsteel
 最后编辑者: ngsteel,