gpt4 book ai didi

html - -webkit-文本-安全 : disc; is not working in IE

转载 作者:行者123 更新时间:2023-11-28 14:40:10 27 4
gpt4 key购买 nike

我应用了 css -webkit-text-security: disc;将单词屏蔽为密码,但它在 Internet Explorer 中不起作用。

这是我的代码:

.hide{
-webkit-text-security:disc;
}
<h1 class="hide">HideMe</h1>

它适用于 chrome 但不适用于 IE。请给我解决方案。谢谢。

最佳答案

-webkit- 是一个 vendor prefix :

Browser vendors sometimes add prefixes to experimental or nonstandard CSS properties and JavaScript APIs, so developers can experiment with new ideas while—in theory—preventing their experiments from being relied upon and then breaking web developers' code during the standardization process. Developers should wait to include the unprefixed property until browser behavior is standardized.

... 由 webkit 渲染引擎使用,Internet Explorer 不使用。

它的实验性很强,甚至没有出现在 CSS 规范草案中。没有其他浏览器支持它,或具有不同供应商前缀的版本。

如果你想获得这种效果,你需要应用 JavaScript(例如,通过使用覆盖在元素上的不可见密码字段,你每次根据输入值的长度为其添加元素符号 input 事件触发。

关于html - -webkit-文本-安全 : disc; is not working in IE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53080152/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com