Html 如何在MS Edge和IE中对密码输入隐藏眼睛
我现在找到了答案: 它只在我添加Html 如何在MS Edge和IE中对密码输入隐藏眼睛,html,css,internet-explorer,input,microsoft-edge,Html,Css,Internet Explorer,Input,Microsoft Edge,我现在找到了答案: 它只在我添加display:none时起作用!重要的。我不知道,到底是什么阻止了显示:无但如果其他人有此错误,请尝试添加!重要信息,并检查输入是否为密码字段 原始问题: 我有一个自定义添加的“显示密码”按钮的密码输入。现在我想删除由MS Edge和IE添加的密码按钮。 我已经试过了: input[type=“password”]:-ms-leaver, 输入[type=“password”]:-ms清除{ 显示:无; } 及 输入::-ms显示, 输入::-ms清除{ 显示
display:none时起作用!重要的代码>。我不知道,到底是什么阻止了显示:无代码>但如果其他人有此错误,请尝试添加!重要信息
,并检查输入是否为密码字段
原始问题:
我有一个自定义添加的“显示密码”按钮的密码输入。现在我想删除由MS Edge和IE添加的密码按钮。
我已经试过了:
input[type=“password”]:-ms-leaver,
输入[type=“password”]:-ms清除{
显示:无;
}
及
输入::-ms显示,
输入::-ms清除{
显示:无;
}
::ms clear
正在工作,并删除用户可以清除输入的小x
。但是::ms discover
不起作用。在IE 11中测试,MS Edge基于铬,最新MS Edge不基于铬
,,
右边的眼睛是我的自定义添加的眼睛,另一个是IE或Edge添加的眼睛
以下是我的输入样式:
/*
BASIC INPUT STYLING
*/
input, textarea, select {
outline: none;
border-radius: 6px;
box-sizing: border-box;
box-shadow: none;
font-family: 'Roboto', sans-serif;
font-weight: 300;
line-height: 1;
font-size: 16px;
-webkit-appearance: none;
-moz-appearance: none;
-ms-appearance: none;
color: #222222;
background-color: transparent;
border: 1px solid #CCCCCC;
padding: 18px 22.5px;
transition: border-color .15s ease-in-out;
width: 100%;
}
input:focus, textarea:focus, select:focus {
border: 1px solid #999999;
}
.input-small input, .input-small select, .input-small textarea {
font-size: 14px;
padding: 9px 11.25px;
}
/*
INPUT WITH ICON STYLING
*/
.input-with-icon {
position: relative;
}
.input-with-icon input, .input-with-icon select {
padding-right: 62.5px;
}
.input-with-icon.input-small input, .input-with-icon.input-small select {
padding-right: 32px;
}
.input-icon-div {
height: 51px;
border-radius: 6px;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
width: 40px;
position: absolute;
right: 5px;
bottom: 2px;
cursor: pointer;
}
.input-small .input-icon-div {
font-size: 14px;
height: 27px;
width: 25px;
}
以及HTML:
<div class="input-with-icon">
<input type="password" name="password" id="password" class="" maxlength="255">
<div class="input-icon-div">
<i class="far fa-eye"></i>
</div>
</div>
我尝试在IE 11、MS Edge legacy浏览器、MS Edge Chromium浏览器和Firefox上测试这两个代码
它在我这边起作用了,它没有显示“显示密码”按钮(眼睛)
测试代码:
输入::-ms显示,
输入::-ms清除{
显示:无;
}
密码:
当您在字段中键入内容时,从版本92开始,它仍然显示在Edge中。根据这项研究,解决办法是
::-ms-reveal {
display: none;
}
它们还显示了自定义按钮的方法这是否回答了您的问题?这与建议副本的答案中的信息相同。