非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

-webkit-text-security is a non-standard CSS property that obfuscates characters in a <form> field (such as <input> or <textarea> ) by replacing them with a shape. It only affects fields that are not of type=password .

句法

-webkit-text-security: circle;
-webkit-text-security: disc;
-webkit-text-security: square;
-webkit-text-security: none;
					

形式定义

Value not found in DB!

形式句法

Syntax not found in DB!
					

范例

Obscuring a text input

Try typing in the field below. If your browser supports this property, the characters should be visually replaced with squares.

HTML

<label for="name">Name:</label>
<input type="text" name="name" id="name" />
					

CSS

input {
  -webkit-text-security: square;
}
					

结果

规范

Not part of any standard.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-webkit-text-security 非标 Chrome 完整支持 1 Edge 完整支持 79 Firefox 不支持 No IE 不支持 No Opera 完整支持 15 Safari 完整支持 3 WebView Android 完整支持 ≤37 Chrome Android 完整支持 18 Firefox Android 不支持 No Opera Android 完整支持 14 Safari iOS 完整支持 1 Samsung Internet Android 完整支持 1.0

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考